This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年10月22日 09:26 by erickt, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| fix_defaultdict_reduce.patch | ocean-city, 2008年10月22日 11:32 | |||
| fix_defaultdict_reduce_v2.patch | ocean-city, 2008年10月23日 00:13 | also test with HIGHEST_PROTOCOL | ||
| Messages (7) | |||
|---|---|---|---|
| msg75073 - (view) | Author: Erick Tryzelaar (erickt) | Date: 2008年10月22日 09:26 | |
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: (PyIter_Check(iter)), function PyIter_Next, file Objects/abstract.c, line 2751. zsh: abort /tmp/python/bin/python3.0 foo.py |
|||
| msg75076 - (view) | Author: Hirokazu Yamamoto (ocean-city) * (Python committer) | Date: 2008年10月22日 11:32 | |
On py3k, defaultdict#items() returns dict_items object not dict_itemiterator object. I hope attached patch will fix this bug. |
|||
| msg75086 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2008年10月22日 16:18 | |
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()) |
|||
| msg75087 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2008年10月22日 16:23 | |
My previous example also crashes python 2.4 & 2.6 (the classes have to inherit from 'object') |
|||
| msg75095 - (view) | Author: Hirokazu Yamamoto (ocean-city) * (Python committer) | Date: 2008年10月22日 18:21 | |
>My previous example also crashes python 2.4 & 2.6 (the classes have to inherit from 'object') I created new tracker item for this. (See issue4176) |
|||
| msg75126 - (view) | Author: Hirokazu Yamamoto (ocean-city) * (Python committer) | Date: 2008年10月23日 00:13 | |
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 issue4183. |
|||
| msg75380 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2008年10月30日 20:58 | |
Fixed with r67048. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:40 | admin | set | github: 48420 |
| 2008年10月30日 20:58:54 | amaury.forgeotdarc | set | status: open -> closed resolution: fixed messages: + msg75380 |
| 2008年10月23日 00:13:46 | ocean-city | set | files:
+ fix_defaultdict_reduce_v2.patch messages: + msg75126 |
| 2008年10月22日 18:21:17 | ocean-city | set | messages: + msg75095 |
| 2008年10月22日 16:23:18 | amaury.forgeotdarc | set | messages: + msg75087 |
| 2008年10月22日 16:18:23 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages: + msg75086 |
| 2008年10月22日 11:32:04 | ocean-city | set | files:
+ fix_defaultdict_reduce.patch keywords: + patch messages: + msg75076 nosy: + ocean-city |
| 2008年10月22日 09:26:46 | erickt | create | |