Message215716
len() on WeakKeyDictionarys can fail with ValueErrors when _IterationGuards are kept alive
Attached is a test showing this:
======================================================================
ERROR: test_weak_keys_len_destroy_while_iterating (__main__.MappingTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "Lib/test/test_weakref.py", line 1336, in test_weak_keys_len_destroy_while_iterating
self.assertEqual(len(dict), 0)
ValueError: __len__() should return >= 0
One probably shouldn't keep them alive like this, but __len__ shouldn't be blowing up either. On non ref counting GC platforms this situation is easier to trigger unintentionally |
|
Date |
User |
Action |
Args |
2014-04-07 20:17:27 | pjenvey | set | recipients:
+ pjenvey, pitrou |
2014-04-07 20:17:27 | pjenvey | set | messageid: <1396901847.85.0.817641964544.issue21173@psf.upfronthosting.co.za> |
2014-04-07 20:17:27 | pjenvey | link | issue21173 messages |
2014-04-07 20:17:27 | pjenvey | create | |
|