[issue4170] segfault with defaultdict and pickle
Amaury Forgeot d'Arc
report at bugs.python.org
Wed Oct 22 18:18:24 CEST 2008
Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
The pickle protocol should also check that __reduce__ returns iterators
(iterables are not enough).
The code below crashes the interpreter (twice ;-)
class C:
def __reduce__(self):
return C, (), None, None, []
class D:
def __reduce__(self):
return D, (), None, [], None
import pickle
pickle.dumps(C())
pickle.dumps(D())
----------
nosy: +amaury.forgeotdarc
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4170>
_______________________________________
More information about the Python-bugs-list
mailing list