cpython/Modules/_io
Miss Islington (bot) c3bb32de9d
[3.12] gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059) (GH-127326)
Since MultiByteToWideChar()/WideCharToMultiByte() is not reversible if
the data contains invalid UTF-8 sequences, use binary search to
calculate the number of written bytes from the number of written
characters.

Also fix writing incomplete UTF-8 sequences.

Also fix handling of memory allocation failures.
(cherry picked from commit 3cf83d91a5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-11-27 16:00:30 +02:00
..
clinic
_iomodule.c
_iomodule.h
bufferedio.c
bytesio.c
fileio.c
iobase.c
stringio.c [3.12] gh-127182: Fix io.StringIO.__setstate__ crash when None is the first value (GH-127219) (#127263) 2024-11-25 17:51:21 +00:00
textio.c
winconsoleio.c [3.12] gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059) (GH-127326) 2024-11-27 16:00:30 +02:00