Serhiy Storchaka added the comment:

Actually the tp_new field of list iterator class is NULL. Unpickler raises 
other error in such case (see issue24900 for example).

    UnpicklingError: NEWOBJ class argument has NULL tp_new

Backported to 2.7 the part of the patch for issue22995 fixes this issue.

>>> copy.copy(iter([]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython-2.7/Lib/copy.py", line 88, in copy
    rv = reductor(2)
TypeError: can't pickle listiterator objects

----------
dependencies: +Restrict default pickleability
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14350>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to