msg156798 - (view) |
Author: Ankit Agrawal (ankit615) |
Date: 2012-03-26 04:41 |
I'm trying to run python (version 2.7.2) on my computer (windows vista 32bit). It's always worked until now when Idle just does not respond to any commands. Any commands entered (even very simple ones) have no output/do not get computed! See image: http://dl.dropbox.com/u/32209936/image%20idle%20Idle.jpg Python works fine when I run it using command line though! See image: http://dl.dropbox.com/u/32209936/image%20python%20command%20line.jpg I've tried re-installing it a few times but it just doesn't help! Also tried running it from C:\Python27\Lib\idlelib\idle.py and I get the following message before the same unresponsive IDLE pops up again! See image: http://dl.dropbox.com/u/32209936/image%20python%20warnings.jpg Checked the file config-keys.def under C:\Python27\Lib\idlelib and its permissions. Also checked all other config-*.def files in this folder. |
|
|
msg156800 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2012-03-26 07:39 |
Hi Ankit, It looks like your configuration files for IDLE has a bug. Can you try renaming your .idlerc directory (likely located in your home directory) to something else and then retry using IDLE? Also, can you post your existing config-main.cfg and config-keys.cfg? This may help in making IDLE more robust against this error in the future. |
|
|
msg156877 - (view) |
Author: Ankit Agrawal (ankit615) |
Date: 2012-03-26 22:55 |
Hello Roger, Thanks much for the comment. What you're saying seems right! I've tried renaming the .idlerc folder (which I did find in my home folder) but this just gives me an error. See Image: http://dl.dropbox.com/u/32209936/rename%20problem.jpg After a few tries I wasn't sure how to handle this so I simply removed the folder from my home directory to see if it made a difference which to my delight, fixed the problem (to seems to be working so far)! At the same time, IDLE seems to have created a new one for itself and I wanted to check whether I need to add any files from the .idlerc folder I removed to the new one. I'd be glad to post my existing files,however I only seem to have config-extensions.cfg and the file named "config-keys.cfg" seems to be missing from my folder. I was wondering if this would be of any help? |
|
|
msg156878 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2012-03-26 23:08 |
I'm glad to hear that IDLE now works. IDLE will recreate .idlerc if it doesn't exist and populate it with your settings. If you can, please post your original, broken .cfg files. I'll try to decipher the cause of the original problem. |
|
|
msg156994 - (view) |
Author: Ankit Agrawal (ankit615) |
Date: 2012-03-28 18:15 |
Please find attached, the original .cfg files that I was found in my idlerc folder. I hope this proves helpful. If you need any other information I'd be glad to help. |
|
|
msg156995 - (view) |
Author: Ankit Agrawal (ankit615) |
Date: 2012-03-28 18:16 |
Another cfg file from the original .idlerc folder |
|
|
msg157000 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2012-03-28 19:10 |
Thank you for the configuration files. It helped with finding the bug. The default key bindings in configHandler.py is incorrect for <> which caused the problem Ankit experienced. This problem affects the 2.7 and 3.3 series. Attached is a patch against 3.3 (and 2.7) to fix the issue. |
|
|
msg157007 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2012-03-28 19:59 |
Roger, I notice that the line your patch modifies in configHandler.py has been unchanged for years and is the same in older Python versions. My impression from Ankit's description is that this is a new problem. What's different or am I misunderstanding something? |
|
|
msg157009 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2012-03-29 03:13 |
Ned, the buggy default keybinding for <> requires that Key-Return and then Key-KP_Enter be pressed before the virtual event triggers. This happens because both key events are present in a single string. The correct behavior requires each key event be listed in a separate string in a list. (See <> for an example). MultiCall.py has code (event_add) that iterates over the list and binds each key to an event. This bug is also present in 2.3.5. (I just downloaded and tested it on XP.) |
|
|
msg157041 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2012-03-29 13:21 |
I agree with Roger's patch. But I'm pretty sure Ankit had another problem just because IDLE shell works for everyone without that patch. |
|
|
msg157054 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2012-03-29 14:59 |
IDLE contains keyboard configuration in config-keys.def (Mac, Windows, UNIX) and in configHandler.py. GetCoreKeys contains the "keyBindings" dict which has fall-back values in case the given key set is missing values (a warning is printed). Ankit's screenshot contains these warning messages. GetKeyBinding is a helper function that splits a string containing multiple key bindings. Read the commented header in config-keys.def to see why this is so. The fall-back values in keyBindings do not pass through the GetKeyBinding function, and thus " <Key-KP_enter>" does not get split. Everyone else uses IDLE's prepackaged key bindings as a starting point for creating custom key maps. The key maps from config-keys.def already passed through GetKeyBinding. This is why works for everyone else. |
|
|
msg157059 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-03-29 16:01 |
New changeset 26b2407c644e by Andrew Svetlov in branch '3.2': Issue #14409: IDLE doesn't not execute commands from shell with default keybinding for . http://hg.python.org/cpython/rev/26b2407c644e |
|
|
msg157068 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-03-29 16:55 |
New changeset 87ada87057a2 by Andrew Svetlov in branch '2.7': Backport of Issue #14409 to 2.7 http://hg.python.org/cpython/rev/87ada87057a2 |
|
|
msg157069 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2012-03-29 16:58 |
Roger, now your solution is completely clean for me. I pushed your patch to 2.7, 3.2 and 3.3 branches. Thank you. |
|
|
msg157094 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2012-03-29 20:24 |
(Thanks for the expanded analysis, Roger. I missed the implication of the title update you made.) |
|
|