New submission from Jakob Bowyer <jkb...@gmail.com>: Running: Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] Code: import copy copy.copy(iter([1,2,3])) Exception:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) T:\languages\Python27\Scripts\<ipython-input-2-4b0069a09ded> in <module>() ----> 1 copy.copy(iter([1,2,3])) T:\languages\Python27\lib\copy.pyc in copy(x) 94 raise Error("un(shallow)copyable object of type %s" % cl s) 95 ---> 96 return _reconstruct(x, rv, 0) 97 98 T:\languages\Python27\lib\copy.pyc in _reconstruct(x, info, deep, memo) 327 if deep: 328 args = deepcopy(args, memo) --> 329 y = callable(*args) 330 memo[id(x)] = y 331 T:\languages\Python27\lib\copy_reg.pyc in __newobj__(cls, *args) 91 92 def __newobj__(cls, *args): ---> 93 return cls.__new__(cls, *args) 94 95 def _slotnames(cls): TypeError: object.__new__(listiterator) is not safe, use listiterator.__new__() Either this is a bug or not a clear error message in the exception ---------- components: None messages: 156189 nosy: Jakob.Bowyer priority: normal severity: normal status: open title: Strange Exception from copying an iterable type: behavior versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14350> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com