cpython/Modules/_io
Jelle Zijlstra 6a48876b48
[3.14] gh-159739: Validate newline replacement in TextIOWrapper.write (GH-160191) (#160487)
A str subclass can override replace() and return a non-string while TextIOWrapper.write() translates newlines. The C implementation then treats the result as Unicode and can crash. Reject an invalid replacement with TypeError. Backport to 3.15 and 3.14; on 3.14, put the regression test in Lib/test/test_io.py.
(cherry picked from commit c6796a1268)
2026-10-24 13:43:55 -07:00
..
clinic [3.14] gh-157364: Fix use-after-free in io.TextIOWrapper during reentrant detach (#159600) 2026-10-16 23:53:10 +00:00
_iomodule.c [3.14] gh-150285: Fix too long docstrings in the io module (GH-150287) (GH-150458) 2026-05-26 09:10:39 +00:00
_iomodule.h gh-117151: IO performance improvement, increase io.DEFAULT_BUFFER_SIZE to 128k (GH-118144) 2025-03-07 11:36:12 -08:00
bufferedio.c [3.14] gh-149816: add missing critical section on self in buffered_iternext (GH-150295) (#150306) 2026-05-23 14:56:44 +05:30
bytesio.c [3.14] gh-159739: Recheck BytesIO state after converting truncate size (GH-160190) (#160385) 2026-10-23 01:35:08 +00:00
fileio.c [3.14] gh-150285: Fix too long docstrings in the io module (GH-150287) (GH-150458) 2026-05-26 09:10:39 +00:00
iobase.c [3.14] gh-159739: Respect readline limits after a short read (GH-159974) (#160483) 2026-10-24 13:42:51 -07:00
stringio.c [3.14] gh-149046: fix: correctly handle str subclasses in io.StringIO (GH-149047) (#150707) 2026-06-01 13:26:30 +00:00
textio.c [3.14] gh-159739: Validate newline replacement in TextIOWrapper.write (GH-160191) (#160487) 2026-10-24 13:43:55 -07:00
winconsoleio.c [3.14] gh-72353: Continue reading from the console after ignored Ctrl+C (GH-155434) (GH-156590) 2026-08-29 18:39:43 +00:00