Serhiy Storchaka added the comment:

> When I run the following code on Windows/Linux for < Python 3.6, I have no 
> problems.

You have a problem. Did you try to use the copied object? It is a broken Struct 
object.

>>> copied = copy.deepcopy(this_fails)
>>> copied.format
>>> copied.size
-1
>>> copied.pack(42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
struct.error: pack expected -1 items for packing (got 1)
>>> copied.unpack(b'abcd')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
struct.error: unpack requires a bytes object of length -1

Copying Struct object never worked. Now it raises an error rather than silently 
creating a broken object.

----------
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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

Reply via email to