msg58805 - (view) |
Author: Quentin Gallet-Gilles (quentin.gallet-gilles) |
Date: 2007-12-19 13:08 |
While investigating for the stdlib reorg of Tkinter, I came across the following error: ~/dev/py3k$ ./python Lib/lib-tk/Dialog.py Traceback (most recent call last): File "Lib/lib-tk/Dialog.py", line 45, in Pack: {}}) File "/home/quentin/dev/py3k/Lib/lib-tk/Tkinter.py", line 1996, in __init__ Widget.__init__(self, master, 'button', cnf, kw) File "/home/quentin/dev/py3k/Lib/lib-tk/Tkinter.py", line 1921, in __init__ for k in cnf.keys(): RuntimeError: dictionary changed size during iteration The attached patch adds list() around the dict.keys() call. On a related note, this doesn't appear to be an isolated error, since a similar issue (#1649) was recently fixed in r59554. Would it be a good idea to look for other identical cases ? |
|
|
msg58815 - (view) |
Author: Christian Heimes (christian.heimes) *  |
Date: 2007-12-19 17:48 |
Yes, it sounds like a good idea. The patch should be applied to 2.6. |
|
|
msg67517 - (view) |
Author: Guilherme Polo (gpolo) *  |
Date: 2008-05-30 02:14 |
There is this same problem at scrolledtext.py (new name). I'm attaching a patch that is a bit different that correct both cases. |
|
|
msg72428 - (view) |
Author: Guilherme Polo (gpolo) *  |
Date: 2008-09-03 22:46 |
Can someone review the patch and apply please ? It is sad to leave tkinter like this in py3k. Clearly there are not much people using it there, but it is something very simple to fix. |
|
|
msg72487 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-09-04 07:32 |
The patch is indeed simple. A minor stylistic remark: instead of for c in classes: del cnf[c[0]] it would be clearer to write for k, v in classes: del cnf[v] like the other loop does, 3 lines after. Please apply. |
|
|
msg72492 - (view) |
Author: Guilherme Polo (gpolo) *  |
Date: 2008-09-04 11:24 |
Committed r66215 I've applied this only in py3k since it doesn't affect python 2.6 |
|
|
msg97419 - (view) |
Author: Sridhar Ratnakumar (srid) |
Date: 2010-01-08 17:26 |
I get this error while running Python 2.6.4 tests (on 64-bit Linux box) test_urllib test test_urllib failed -- Traceback (most recent call last): File "/home/apy/rrun/tmp/autotest/apy/lib/python2.6/test/test_urllib.py", line 104, in setUp for k, v in os.environ.iteritems(): RuntimeError: dictionary changed size during iteration Should open a new bug? |
|
|
msg97422 - (view) |
Author: Florent Xicluna (flox) *  |
Date: 2010-01-08 17:50 |
> test_urllib > test test_urllib failed -- Traceback (most recent call last): > File "/home/apy/rrun/tmp/autotest/apy/lib/python2.6/test/test_urllib.py", line 104, in setUp > for k, v in os.environ.iteritems(): > RuntimeError: dictionary changed size during iteration I reopened for this one. |
|
|