Mark Dickinson <[email protected]> added the comment:
Okay, I can reproduce by adding a 'time.sleep(0.01)' delay into the body of the
'for name, val in locals().items():' loop. I then get (with py3k):
dicki...@alberti:~/Source/py3k> ./python
Python 3.2a0 (py3k:82413M, Jul 1 2010, 10:21:02)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import decimal, profile
>>> def show_bug(): decimal.Decimal(1.2)**(-2**31)
...
>>> profile.run('show_bug()')
Traceback (most recent call last):
File "/home/dickinsm/Source/py3k/Lib/decimal.py", line 447, in getcontext
return _local.__decimal_context__
AttributeError: '_thread._local' object has no attribute '__decimal_context__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dickinsm/Source/py3k/Lib/profile.py", line 70, in run
prof = prof.run(statement)
File "/home/dickinsm/Source/py3k/Lib/profile.py", line 442, in run
return self.runctx(cmd, dict, dict)
File "/home/dickinsm/Source/py3k/Lib/profile.py", line 448, in runctx
exec(cmd, globals, locals)
File "<string>", line 1, in <module>
File "<stdin>", line 1, in show_bug
File "/home/dickinsm/Source/py3k/Lib/decimal.py", line 2222, in __pow__
context = getcontext()
File "/home/dickinsm/Source/py3k/Lib/decimal.py", line 449, in getcontext
context = Context()
File "/home/dickinsm/Source/py3k/Lib/decimal.py", line 3822, in __init__
for name, val in locals().items():
RuntimeError: dictionary changed size during iteration
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue9136>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com