Message11882

Author psykiatris
Recipients amit, fwierzbicki, psykiatris, santa4nt, tuck182, zyasoft
Date 2018-04-06.13:51:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523022669.27.0.682650639539.issue2363@psf.upfronthosting.co.za>
In-reply-to
Content
I hate it when I goof up. But, readline() does not work correctly when seek is used.

I updated my test script to better display the info, and to allow people to pass size and the seek amount to the function. it ended up clearly showing Iin the seekboth function, this:

Output:
File position from read():      1024
File position from readline():  4202
Amount to seek back:           -1024
New position in file:           3278
Wrong position

The function returns the correct position in Python 2.7.12

But, really, readline() *should* only read the line to the newline, which is 101 (test.log shows the first line as 100 '.' with a newline.) This is verified by the seekreadline call in the test file.
History
Date User Action Args
2018-04-06 13:51:09psykiatrissetmessageid: <1523022669.27.0.682650639539.issue2363@psf.upfronthosting.co.za>
2018-04-06 13:51:09psykiatrissetrecipients: + psykiatris, fwierzbicki, zyasoft, tuck182, santa4nt, amit
2018-04-06 13:51:09psykiatrislinkissue2363 messages
2018-04-06 13:51:08psykiatriscreate