New submission from Dustin Oprea: The memory is resized, but the value returned by len() doesn't change:
>>> b = ctypes.create_string_buffer(23) >>> len(b) 23 >>> b.raw = '0' * 23 >>> b.raw = '0' * 24 Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: string too long >>> ctypes.resize(b, 28) >>> len(b) 23 >>> b.raw = '0' * 28 >>> b.raw = '0' * 29 Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: string too long ---------- components: ctypes messages: 217005 nosy: Dustin.Oprea priority: normal severity: normal status: open title: Resize doesn't change reported length on create_string_buffer() versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21328> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com