Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Fixed with r67048.
--
resolution: - fixed
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4170
___
New submission from Erick Tryzelaar [EMAIL PROTECTED]:
It seems like there's a bug with defaultdict. This is segfaulting with
the latest python 3.0 svn checkout:
import collections, pickle
d=collections.defaultdict(int)
d[1]
pickle.dumps(d)
It errors out with:
Assertion failed:
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
On py3k, defaultdict#items() returns dict_items object not
dict_itemiterator object. I hope attached patch will fix this bug.
--
keywords: +patch
nosy: +ocean-city
Added file:
Amaury Forgeot d'Arc [EMAIL PROTECTED] 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:
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
My previous example also crashes python 2.4 2.6 (the classes have to
inherit from 'object')
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4170
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
I created test case referring to test_bytes, but I noticed
range(pickle.HIGHETST_PROTOCOL) doesn't test HIGHEST_PROTOCOL itself. So
patch revised. I created another tracker item for other tests using
range(pickle.HIGHETST_PROTOCOL). See