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.

Author mark.dickinson
Recipients ezio.melotti, mark.dickinson, skrah, ubershmekel
Date 2010-07-01.09:41:07
SpamBayes Score 1.0174886e-06
Marked as misclassified No
Message-id <1277977270.44.0.917356557845.issue9136@psf.upfronthosting.co.za>
In-reply-to
Content
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):

dickinsm@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
History
Date User Action Args
2010-07-01 09:41:10mark.dickinsonsetrecipients: + mark.dickinson, ezio.melotti, ubershmekel, skrah
2010-07-01 09:41:10mark.dickinsonsetmessageid: <1277977270.44.0.917356557845.issue9136@psf.upfronthosting.co.za>
2010-07-01 09:41:09mark.dickinsonlinkissue9136 messages
2010-07-01 09:41:07mark.dickinsoncreate