New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segfault with defaultdict and pickle #48420
Comments
It seems like there's a bug with defaultdict. This is segfaulting with import collections, pickle
d=collections.defaultdict(int)
d[1]
pickle.dumps(d) It errors out with: Assertion failed: (PyIter_Check(iter)), function PyIter_Next, file |
On py3k, defaultdict#items() returns dict_items object not |
The pickle protocol should also check that __reduce__ returns iterators 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()) |
My previous example also crashes python 2.4 & 2.6 (the classes have to |
I created new tracker item for this. (See bpo-4176) |
I created test case referring to test_bytes, but I noticed |
Fixed with r67048. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: