Serhiy Storchaka added the comment:

Different error messages are needed if original offset < 0. For example packing 
4 bytes with offset -2 always fails, not depending of the size of the buffer. 
Packing into buffer of size 10 with offset -11 always fails, not depending of 
the size of packed data.

struct.pack_into('<I', bytearray(10), -2, 123)
struct.pack_into('<B', bytearray(10), -11, 123)

----------
assignee:  -> serhiy.storchaka

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

Reply via email to