[issue29649] struct.pack_into check boundary error message didn't respect offset

2017-03-03 Thread Andrew Nester
Andrew Nester added the comment: thanks Serhiy! just implemented your variant in my PR. -- ___ Python tracker ___

[issue29649] struct.pack_into check boundary error message didn't respect offset

2017-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Or "pack_into requires a buffer of at least 6 bytes for packing 1 bytes at offset 5". -- ___ Python tracker ___

[issue29649] struct.pack_into check boundary error message didn't respect offset

2017-03-03 Thread Andrew Nester
Andrew Nester added the comment: yeah, I also thought about this too. Something like 'pack_into requires a buffer of at least 6 bytes (size is 1, offset is 5)' -- ___ Python tracker

[issue29649] struct.pack_into check boundary error message didn't respect offset

2017-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not sure the new error message is better. It is not known what is wrong -- the size of the buffer, or the offset? I think that the better error message should include three numbers: the offset, the size of the destination buffer, and the size of packed

[issue29649] struct.pack_into check boundary error message didn't respect offset

2017-03-03 Thread Andrew Nester
Changes by Andrew Nester : -- pull_requests: +354 ___ Python tracker ___ ___

[issue29649] struct.pack_into check boundary error message didn't respect offset

2017-03-03 Thread Andrew Nester
Andrew Nester added the comment: Thanks! Just added PR fixing this. -- nosy: +andrewnester ___ Python tracker ___

[issue29649] struct.pack_into check boundary error message didn't respect offset

2017-02-25 Thread Louie Lu
New submission from Louie Lu: For this situation, check boundary error message didn't correctly show out. >>> import struct >>> import ctypes >>> byte_list = ctypes.create_string_buffer(1) >>> struct.pack_into('b', byte_list, 5, 1) Traceback (most recent call last): File "", line 1, in