You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
io.StringIO corrupts its contents after writing a str subclass #158213
Since GH-157861, the first write of a str subclass instance into an empty PyUnicodeWriter keeps that object as the buffer, so PyUnicodeWriter_Finish() returns the subclass instance instead of a str. In io.StringIO, getvalue() then returns the written object itself, and the next write re-reads it through its __str__(), which changes the contents:
Activity
gh-158213: Don't return a str subclass from PyUnicodeWriter_Finish() (#…