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.

classification
Title: IDLE fails to "Delete Custom Key Set" properly
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: IDLE: Fix deletion of custom themes and key bindings
View: 27245
Assigned To: Nosy List: alex_fainshtein, gpolo, nicholas.allevato, roger.serwy, terry.reedy
Priority: normal Keywords: patch

Created on 2008-12-29 04:38 by alex_fainshtein, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
removekeybindingswhiletheyexist.diff gpolo, 2009-08-04 17:56 review
Messages (8)
msg78439 - (view) Author: Alex Fainshtein (alex_fainshtein) Date: 2008-12-29 04:38
How to reproduce:
1. Start IDLE -> "Python Shell" window opens.
2. Open Options|"Configure Idle...".
3. In "idle" dialog select "Keys" tab.
4. Click "Set as New Custom Key Set" button.
5  In "New Custom Key Set" dialog, type a name, click "Ok".
4. Click "Apply". Then notice that in the folder

   C:\Documents and Settings\<user>\.idlerc,

   two new files appear, config-keys.cfg and config-main.cfg. The
contents of the latter is

[Keys]
default = 0
name = <Key Set Name>

SO FAR ALL IS OK.

5. Now go back to "idle" dialog, click "Delete Custom Key Set", then
"Apply". Notice that config-keys.cfg file disappeared, but
config-main.cfg neither disappeared nor changed. My guess, THIS IS THE BUG.

6. Now click "Ok" - no reaction. Click "Cancel" - crash: the Python
windows disappear. Try to restart IDLE - it WOULD NOT START until
config-main.cfg is manually deleted.
msg91261 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-08-04 17:56
Interesting, this is reproducible in any version under any OS but it is
more noticeable under Windows. In the step 6 you mentioned, IDLE is busy
printing warnings that you will never see if you don't run IDLE from a
terminal. Also, when you tried restarting IDLE I believe it were
actually starting up but wasting a lot of time with this non-existing
key binding.

The problem is that when you ask to delete a custom key set, given the
steps pointed out, IDLE will first remove the custom key bindings and
then will try to remove the bindings associated with the just removed
key bindings which will generate a lot of warnings since they no longer
exist.
A simple solution is to invert some steps when "Apply" is pressed so the
bindings are removed while they still exist in the config-keys.cfg file.
But if you have a config-keys.cfg like you described below and start
IDLE, it will still take a long time to load (at least it does in a
virtual machine here).
msg144844 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-10-03 22:09
Note the config-main.cfg contains all custom configurations and appears if you make any one of them. Mine currently says

[EditorWindow]
font = lucida sans unicode

[General]
autosave = 1

So deleting it is a hack workaround until the bug is fixed.
msg152136 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-01-27 22:58
#13836 is another report of key-binding deletion not working correctly, although IDLE did eventually open and allow re-deletion.
msg152147 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2012-01-28 03:12
I am unable to reproduce this bug with the latest development versions in the 2.7 and 3.3 branches. 

Can someone verify this as well?
msg220039 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-08 17:15
This is still a problem on Windows 7 with 3.4.1 but the patch file fixes it.
msg220057 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-06-08 21:26
Add to my list of patches to review.
msg296484 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-20 20:19
This issue (and a similar one for custom themes) was fixed in #27245 with a different patch, but to the same effect.
History
Date User Action Args
2022-04-11 14:56:43adminsetgithub: 49015
2017-06-20 20:19:28terry.reedysetstatus: open -> closed

superseder: IDLE: Fix deletion of custom themes and key bindings

nosy: - BreamoreBoy
messages: + msg296484
resolution: duplicate
stage: test needed -> resolved
2014-06-08 21:26:17terry.reedysetmessages: + msg220057
versions: + Python 3.4, Python 3.5, - Python 3.2, Python 3.3
2014-06-08 18:34:55nicholas.allevatosetnosy: + nicholas.allevato
2014-06-08 17:15:30BreamoreBoysetnosy: + BreamoreBoy
messages: + msg220039
2012-01-28 03:12:39roger.serwysetmessages: + msg152147
2012-01-27 22:58:50terry.reedysetmessages: + msg152136
2012-01-27 22:58:43terry.reedylinkissue13836 superseder
2012-01-26 04:29:40terry.reedysetnosy: + roger.serwy
2011-10-03 22:09:06terry.reedysetnosy: + terry.reedy
messages: + msg144844
2011-06-26 21:16:56terry.reedysetversions: + Python 3.2, Python 3.3, - Python 2.6, Python 3.0, Python 3.1
2009-08-04 17:56:47gpolosetversions: + Python 2.6, Python 2.7
2009-08-04 17:56:07gpolosetfiles: + removekeybindingswhiletheyexist.diff
keywords: + patch
messages: + msg91261

versions: + Python 3.1
2009-04-26 22:16:39ajaksu2setpriority: normal
nosy: + gpolo

type: crash -> behavior
stage: test needed
2008-12-29 04:38:39alex_fainshteincreate