[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters
Ryan McCampbell
report at bugs.python.org
Wed Jul 10 01:07:40 EDT 2019
New submission from Ryan McCampbell <rmccampbell7 at gmail.com>:
The ctypes.create_string_buffer function uses the length of the string to create the buffer if no size is provided. Since windows wide chars are UTF-16 the buffer may actually need to be larger to store surrogate pairs. This code crashes on windows:
>>> create_unicode_buffer('\U00010000\U00010000')
ValueError: string too long
----------
messages: 347600
nosy: rmccampbell7
priority: normal
severity: normal
status: open
title: ctypes.create_string_buffer fails on windows with non-BMP characters
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37536>
_______________________________________
More information about the Python-bugs-list
mailing list