Author serhiy.storchaka
Recipients James Hennessy, martin.panter, r.david.murray, serhiy.storchaka
Date 2016-04-19.05:05:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> This still depends on StringIO.tell() corresponding to the number of code points, which is undocumented (we already disable newline translation in the StringIO). See also Issue 25190.

And doesn't work with Python implementation of StringIO. More general solution needs the code like:

pos = file.tell()
tail =
head =
if tail:
    head = head[:-len(tail)]
pos = newfile.tell()  # TextIOWrapper position is opaque
newfile.write(tail), 0)

Yet one bad thing with using independent StringIO instead of TextIOWrapper, is that saved tell() position becomes not valid after rollover(). I'm going to write few tests for cases when file position points not at the end of the stream.
Date User Action Args
2016-04-19 05:05:44serhiy.storchakasetrecipients: + serhiy.storchaka, r.david.murray, martin.panter, James Hennessy
2016-04-19 05:05:44serhiy.storchakasetmessageid: <>
2016-04-19 05:05:44serhiy.storchakalinkissue26730 messages
2016-04-19 05:05:44serhiy.storchakacreate