[issue4832] idle filename extension
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 677a9326b4d4 by Ned Deily in branch 'default': Issue #4832: Modify IDLE to save files with .py extension by http://hg.python.org/cpython/rev/677a9326b4d4 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Ned Deily n...@acm.org added the comment: Terry, are you planning to commit this? If not, I can do it. It would be good to get this into 3.3.0b2 since it does fix an important usability issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Terry J. Reedy tjre...@udel.edu added the comment: I agree. Go ahead. But what do you think of applying to 2.7 and or 3.2? I want to add a sentence to Idle help, which I want to edit for the tooltips issue also. But that is not a rush. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Roger Serwy roger.se...@gmail.com added the comment: I tried issue4832_rev2.patch on Ubuntu 11.04 with Tk 8.5 and it still behaves as Terry described. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Roger Serwy roger.se...@gmail.com added the comment: issue4832_rev1.patch is a complete patch against 3.3. This is also part of issue13504, 7) ANNOYANCE: It’s too easy to forget the .py extension when saving a file. -- stage: - patch review Added file: http://bugs.python.org/file26336/issue4832_rev1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Terry J. Reedy tjre...@udel.edu added the comment: I tested with defaultextension='' on Windows and it works well. If no extension is entered (no '.' in name), .py or .txt is added for the .py/w and .txt filetype choices. If there is a . in the name, nothing is added. If one wants x.y.py, one must type the whole name. So typing x.pyw does not get .py added on top of it. This needs to be documented in the Idle help file. Should the change only be made to 3.3, or also to 3.2/2.7? The old behavior of typing .py still works, so that does not break. Typing no . to get no extension (rare) will break unless one selects '*.* all files' (which one should do anyway as it is standard Windows behavior). I think uniform across versions is better so people who learn leaving out .py on 3.3 can also leave it out in future 2.7 and 3.2, which should come out about the same time as 3.3.0. Whether just one or two or three versions, how do people used to the old (buggy in my opinion) behavior find out about the change. A splash line on startup See help for new 'save as' behavior ? Anything I should know about *nix or mac behavior, at least for the doc? Ned, does this change work on macs? -- assignee: - terry.reedy nosy: +ned.deily stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Roger Serwy roger.se...@gmail.com added the comment: Your description applied to the behavior on Ubuntu 11.04. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Ned Deily n...@acm.org added the comment: As usual, there seem to be small but significant differences among the implementations. Testing with the three OS X Tk implementations shows that currently: 1. Aqua Tk 8.5 and Aqua Tk 8.4 do not supply a default extension when saving. With patch issue4832.diff applied, they still incorrectly do not supply a default extension. (Note, Aqua Tk's do not supply a file type filter in the Save File dialog box.) 2. X11 Tk 8.5 behaves like other Unix X11 Tk's: a default based on the selected File Type filter is used, i.e. .py for Python files, .txt for Text file. Applying the patch does not change that correct behavior. I tested a variation of Guilherme's patch which supplies a defaultextension of '.py' but only for OS X (rather than Windows). With that patch (issue4832_rev2.patch): 1. Aqua Tk 8.5 now correctly supplies a default extension of '.py' on saves if the user does not enter an extension as part of the file name. 2. Aqua Tk 8.4 behavior is unchanged: it still incorrectly does not supply an extension if the user does not. I don't see how to fix that but the use of Aqua Tk 8.4 is diminishing. 3. X11 Tk 8.5 behavior is unchanged: it still correctly supplies a default based on the selected File Type. Since Aqua Tk 8.5 is the major Tk for OS X these days (it has been the system default since OS X 10.6) and the patch improves things for it, I'd like to see this go in. I did test it on a Debian Linux X11. It should behave the same on Windows as Roger's previous patch but it would be good to test it again. As far as documentation changes, I don't see the need to have anything more than the usual IDLE/NEWS.txt file entry. -- Added file: http://bugs.python.org/file26340/issue4832_rev2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Roger Serwy roger.se...@gmail.com added the comment: I was unable to produce the crash that Pavel described in msg87703. Just adding defaultextension='' solves this issue for Windows and still preserves the correct behavior on Linux. Amaury's quote of tcl/tk documentation in msg87695 mentions this as well. I tested this on Linux with 2.7.1 and 3.2 and on Windows Vista using 2.7.1 and 3.2.2. Attached is a diff against 3.3a0. -- nosy: +serwy Added file: http://bugs.python.org/file23956/issue4832.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +terry.reedy versions: +Python 3.3 -Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Terry J. Reedy tjre...@udel.edu added the comment: The behavior (for Windows) I expect and would like is that the default extension would be .py, .txt, or nothing, depending on the selection in the 'save as type' box in the SaveAS dialog. (.pyw, being rare, would have to be explicitly typed.) Of course, doubled extensions like .py.py should be avoided. I believe other apps on Windows do something like this, but I should check. I have no idea how the other systems differ. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Tal Einat talei...@gmail.com added the comment: On Windows, I can't think of any common reason to want to save a file edited in IDLE without the .py extension. On the other hand, accidentally forgetting the .py extension is annoying, and users have come to expect a default extension being added by applications (e.g. MS Office). Guilherme's patch (applied manually) works fine here on Windows7. I'm +1 for committing this if it has been tested to work as expected on Linux and OSX. (minor nit-pick: could use sys.platform.startswith('win') instead of slicing) -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Brian Curtin cur...@acm.org added the comment: I would forget about slicing or using startswith. win32 is the platform name for Python on Windows whether or not it's 64-bit (see PC/pyconfig.h), so I'd just check sys.platform == 'win32' -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Guilherme Polo ggp...@gmail.com added the comment: Sorry but this is just bikeshedding, whoever commits can make this change or if it had been committed without this improvement then anyone could adjust without needing a new issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: With this new patch, is it possible to create a file without extension on Windows? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Guilherme Polo ggp...@gmail.com added the comment: With this new patch, is it possible to create a file without extension on Windows? It is tricky but, answering your question, you could enter a name ending with a period to save without an extension. It seems this isn't going anywhere then. The default behaviour on Linux is to get the .py already, so this patch changes nothing there. On Windows no extension is set by default, and with this patch it is always .py if no extension is specified. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Guilherme Polo ggp...@gmail.com added the comment: I'm attaching a very similar patch that I tested on Linux and Windows. It just combines the default behaviour with the details required for Windows, that is, the default extension is set to '.py' for Windows and '' elsewhere (the default). -- Added file: http://bugs.python.org/file14620/fix_defaultextension.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I think I found the relevant documentation: http://wiki.tcl.tk/1842 On Unix, when typing a filename without extension, the first extension belonging to the currently selected filetype will be appended to the filename. On Windows, this is not the case, but one can define a fixed extension with the -defaultextension option. To get the same behaviour on Unix, use -defaultextension {}. I tried to add defaultextension=.py, (see attached patch) the problem is that now it seems impossible to create a file without an extension... -- keywords: +patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file13978/defaultextension.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Daniel Diniz aja...@gmail.com added the comment: Amaury, Your patch also forces '.py' to any saved file on Linux, but using 'defaultextension = ' it works correctly here. Does if fix things on Windows? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Pavel Kosina g...@post.cz added the comment: Trying to patch the latest revision 72608 and it didnt work, here on winxp. C:\prg\Python30\Lib\idlelibsvn update Restored 'IOBinding.py' At revision 72608. C:\prg\Python30\Lib\idlelibpatch IOBinding.py defaultextension.patch --verbose Hmm... Looks like a unified diff to me... The text leading up to this was: -- |Index: Lib/idlelib/IOBinding.py |=== |--- Lib/idlelib/IOBinding.py (revision 72282) |+++ Lib/idlelib/IOBinding.py (working copy) -- Patching file IOBinding.py using Plan A... Hunk #1 succeeded at 480 (offset -45 lines). Hmm... Ignoring the trailing garbage. done If I do the patch by hand, it works. All files are saved with ext. .py. When set 'defaultextension = ', it is save well too, but then IDLE crashed immediately. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
Daniel Diniz aja...@gmail.com added the comment: I get the .py automatically on Linux, is this an intended behavior difference or should this issue be considered a bug instead? -- nosy: +ajaksu2, gpolo priority: - normal type: behavior - feature request versions: -Python 2.5, Python 2.6, Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4832] idle filename extension
New submission from Pavel Kosina g...@post.cz: There should not be necessity to write filename *with extension* at the saving dialog. It should be enough, at least on Windows, to put there just hello and get hello.py. It is really complication especially for beginners. If they, as they are used to from another programs, put there just hello, it is saved without extension .py what have 2 result: they cannot see any icons at that file and they are not able to run in, cause python.exe is bind with .py. Hoping its not duplicate I haven't found anything like this here. -- components: IDLE messages: 79062 nosy: geon severity: normal status: open title: idle filename extension type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com