Author mrabarnett
Recipients anmyachev, ezio.melotti, mrabarnett, vstinner
Date 2021-10-13.16:25:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634142323.87.0.368813972922.issue45461@roundup.psfhosted.org>
In-reply-to
Content
It can be shortened to this:

buffer = b"a" * 8191 + b"\\r\\n"

with open("bug_csv.csv", "wb") as f:
    f.write(buffer)

with open("bug_csv.csv", encoding="unicode_escape", newline="") as f:
    f.readline()

To me it looks like it's reading in blocks of 8K and then decoding them,  but it isn't correctly handling an escape sequence that happens to cross a block boundary.
History
Date User Action Args
2021-10-13 16:25:23mrabarnettsetrecipients: + mrabarnett, vstinner, ezio.melotti, anmyachev
2021-10-13 16:25:23mrabarnettsetmessageid: <1634142323.87.0.368813972922.issue45461@roundup.psfhosted.org>
2021-10-13 16:25:23mrabarnettlinkissue45461 messages
2021-10-13 16:25:23mrabarnettcreate