Files
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
..