[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Ryan McCampbell
Ryan McCampbell added the comment: Oops my bad, didn't realize this was already fixed -- ___ Python tracker ___ ___

[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> create_unicode_buffer() fails on non-BMP strings on Windows ___ Python tracker

[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Ryan McCampbell
Change by Ryan McCampbell : -- versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Ryan McCampbell
Change by Ryan McCampbell : -- components: +ctypes type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Ryan McCampbell
New submission from Ryan McCampbell : 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: >>>