Issue7105
Created on 2009-10-11 17:29 by pitrou, last changed 2009-11-13 17:39 by pitrou.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
weakiter3.patch
|
pitrou,
2009-10-13 17:24
|
|
|
|
|
msg93863 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2009-10-11 17:29 |
|
As mentioned in issue7060, weak dict iterators are easily broken by
cyclic garbage collection changing the size of the underlying dict storage:
File "/home/rdmurray/python/py3k/Lib/weakref.py", line 121, in items
for wr in self.data.values():
RuntimeError: dictionary changed size during iteration
One possible solution is to delay all removals until all iterators are
done. Here is a context manager-based solution.
|
|
msg93865 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2009-10-11 17:57 |
|
> delay all removals until all iterators are done
+1
|
|
msg93912 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2009-10-12 23:50 |
|
This new patch makes it possible to mutate the dict without messing with
the delayed removal when an iterator exists.
|
|
msg93934 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2009-10-13 17:24 |
|
It occurs weaksets have the same problem, here is a new patch fixing
them as well.
|
|
| Date |
User |
Action |
Args |
| 2009-11-13 17:39:30 | pitrou | set | files:
- weakiter2.patch |
| 2009-11-13 17:39:28 | pitrou | set | files:
- weakiter.patch |
| 2009-10-24 12:55:46 | pitrou | link | issue3578 superseder |
| 2009-10-13 17:24:59 | pitrou | set | files:
+ weakiter3.patch
messages:
+ msg93934 |
| 2009-10-12 23:51:00 | pitrou | set | files:
+ weakiter2.patch
messages:
+ msg93912 |
| 2009-10-11 17:57:27 | gvanrossum | set | nosy:
+ gvanrossum messages:
+ msg93865
|
| 2009-10-11 17:36:34 | jon | set | nosy:
+ jon
|
| 2009-10-11 17:29:50 | pitrou | link | issue7060 dependencies |
| 2009-10-11 17:29:21 | pitrou | create | |
|