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 "<stdin>", line 1, in <module>
struct.error: pack_into requires a buffer of at least 1 bytes
Since offset is setting at 5, it should at least need `offset + soself->s_size`
bytes to store it.
----------
components: Extension Modules
messages: 288564
nosy: louielu
priority: normal
severity: normal
status: open
title: struct.pack_into check boundary error message didn't respect offset
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com