This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年05月29日 07:41 by rhettinger, last changed 2022年04月11日 14:58 by admin.
| Messages (11) | |||
|---|---|---|---|
| msg219338 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2014年05月29日 07:41 | |
In IDLE, edit and save a file foo.py. Then choose File SaveAs. The dialog box only shows "foo", not "foo.py" which is irritating when renaming a file or saving a variant of a file. |
|||
| msg219355 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2014年05月29日 18:33 | |
There are known differences among the various Tk implementations with regard to how file extensions are handled in Tk file dialogs, like IDLE uses; see Issue4832. Can you say which version of Tk was in use (it should be in the About IDLE display) and on what platform? I was not able to reproduce this behavior on any of the current OS X IDLEs and Tks with Save As. |
|||
| msg219424 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年05月30日 19:58 | |
On Win 7, I also see x.py in the save dialog, both 2.7 and 3.4 as installed. |
|||
| msg229117 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年10月12日 05:53 | |
I agree that having .py not visible but written would be obnoxious. Hoever, without more information, I am inclined to close this as a 3rd parth (OS) issue. Saimadhav, can you quickly try Save As with x.py on Linux? |
|||
| msg229128 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2014年10月12日 07:59 | |
> Can you say which version of Tk was in use > (it should be in the About IDLE display) and on what platform? I am using ActiveTcl8.5.15.1 and a latest Python for Macs taken from the python.org download page. I'm running OS X 10.9.5. |
|||
| msg229131 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2014年10月12日 09:06 | |
Thanks, Raymond. Upon further investigation, I think you are running into a user-wide behavior of OS X rather than specifically a Tk or IDLE issue. By tradition and by default, OS X tries to hide file extensions in file Open or Save dialogs; this dates back to the days of Classic Mac OS when there was no concept of file extensions. There is a (non-obvious) user preference in the OS X Finder's preferences (Finder -> Preferences -> Advanced -> Show all filename extensions) that appears to control whether extensions are displayed by default in standard Open and Save dialogs in all applications, not just the Finder. (This is with OS X 10.9.x; I believe recent earlier systems behave similarly although the details might be slightly different). When the preference is unchecked (the default), then in "Save As" dialogs (in IDLE and other apps) a "Hide Extension" option box appears in the lower-left corner of the "Save As" popup window and, if enabled, the extension is not displayed as part of the file name. Unchecking the "Hide Extension" box causes the extension to appear. If the Finder "Show all filename extensions" advanced preference is checked, then the "Hide Extension" box does not appear on the "Save As" popup and the extension is always displayed. I always have the "Show all filename extensions" preference checked so I forgot it was there and its effect on all file dialogs. My guess is that you will want to have it enabled as well and then you should always see extensions. Note that for the initial "Save" of a file in IDLE (as opposed to a "Save As"), Python 3.4 supplies a default extension of ".py" which is displayed regardless of the Finder preference setting; but Python 2.7 up through the current 2.7.8 does not supply the default. That changes in 2.7.9 as Terry has recently backported the 3.x change to 2.7 (Issue4832, although the commit message for the backport appears in Issue3832 due to a typo). |
|||
| msg229136 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年10月12日 09:54 | |
(I moved the commit message) I am assuming that Ned is correct. I think we should start documenting system peculiarities like this. I changed the title and will leave this open for this purpose. |
|||
| msg229178 - (view) | Author: Saimadhav Heblikar (Saimadhav.Heblikar) * | Date: 2014年10月12日 17:06 | |
>>Saimadhav, can you quickly try Save As with x.py on Linux? with files of type python: filename stored on disk -> x.py with all files type : filename stored on disk -> x.py |
|||
| msg229199 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2014年10月12日 21:19 | |
If Raymond concurs that either unchecking the Hide Extensions option or checking the Show All Filenmame Extensions preference solves the problem for him, we should just close this issue. In this particular case, the file is actually saved with a .py extension; it's just that the extension part is not displayed in the standard OS file dialogs. It is visible via, say, "ls" in a UNIX shell. This is standard OS X application behavior and caters to two different styles of file interaction. All OS X applications that use the standard file save dialogs work this way. See, for example, http://support.apple.com/kb/PH13920?viewlocale=en_US&locale=en_US. |
|||
| msg329656 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2018年11月11日 01:29 | |
I should have mentioned before, but forgot, that Windows, by default, hides file name extensions in File Explorer. (The 'type' column supposedly makes them redundant.) If they are hidden, they are also hidden in the Save As name box, as described for MacOS. So I think this is worth a sentence in the doc. After 4 years, I want to close this with or without an edit (for this and/or #4832). The current SaveAs entry is Save the current window with a Save As dialog. The file saved becomes the new associated file for the window. (Ned has previously said leave this alone for both issues.) Proposal: Save the contents of the current window with a Save As dialog. (If your file manager is set to hide extensions, the current extension will be omitted in the file name box.) If the new filename has no '.', '.py' and '.txt' will be added for Python and text files. (On MacOS Aqua, '.py' is added for any type.) The file saved becomes the new associated file for the window. Opinions? |
|||
| msg329720 - (view) | Author: Tal Einat (taleinat) * (Python committer) | Date: 2018年11月12日 06:55 | |
+1 for closing this either way, preferably with a note in the docs. I'd add the notes about extensions in one set of parenthesis at the end, but that's likely just a matter of taste. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:04 | admin | set | github: 65802 |
| 2018年11月12日 06:55:45 | taleinat | set | messages: + msg329720 |
| 2018年11月11日 01:29:17 | terry.reedy | set | nosy:
+ taleinat, - Saimadhav.Heblikar messages: + msg329656 |
| 2017年06月30日 00:48:37 | terry.reedy | set | assignee: terry.reedy stage: test needed versions: + Python 3.6, Python 3.7, - Python 2.7, Python 3.4, Python 3.5 |
| 2014年10月12日 21:19:27 | ned.deily | set | messages: + msg229199 |
| 2014年10月12日 17:06:42 | Saimadhav.Heblikar | set | messages: + msg229178 |
| 2014年10月12日 09:54:10 | terry.reedy | set | messages:
+ msg229136 title: IDLE SaveAs drops the extension in the prompted filename -> IDLE: Document SaveAs extension display on Mac |
| 2014年10月12日 09:06:14 | ned.deily | set | messages: + msg229131 |
| 2014年10月12日 07:59:34 | rhettinger | set | messages: + msg229128 |
| 2014年10月12日 05:53:44 | terry.reedy | set | nosy:
+ Saimadhav.Heblikar messages: + msg229117 |
| 2014年05月30日 19:58:06 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg219424 |
| 2014年05月29日 18:33:14 | ned.deily | set | nosy:
+ ned.deily messages: + msg219355 |
| 2014年05月29日 07:41:12 | rhettinger | create | |