Message11906

Author psykiatris
Recipients amit, fwierzbicki, jeff.allen, psykiatris, santa4nt, zyasoft
Date 2018-04-14.16:12:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523722346.92.0.682650639539.issue2363@psf.upfronthosting.co.za>
In-reply-to
Content
While the fileseek tested "passed" in Python 2.7.12, here is the output:
==========
readline() position->  101
Seek back amt-------> -100
New position-------->    1
Correct position

--- Result of seekboth() ---

read() position------> 1024
readline() position--> 4202
Seek back amt--------> -100
New position---------> 4102
Correct position
========

If you look closely, the readline() test is correct. Readline() reads to the newline character. In the seekboth, however, readline() does NOT read to the newline, reading the whole file. Therefore, while it seems to pass, it actually fails because the "behavior" of readline() is to 'read the line from the file and retain the newline'. Correct?

Now, there's a question of whether this is important, and maybe there's no application in the real world for its use, except looking for "marker" as you mentioned.

I'm expanding my fileseek.py to include seeking forward, but I will NOT upload it... It's at the ad nauseum stage at htis point.
History
Date User Action Args
2018-04-14 16:12:26psykiatrissetmessageid: <1523722346.92.0.682650639539.issue2363@psf.upfronthosting.co.za>
2018-04-14 16:12:26psykiatrissetrecipients: + psykiatris, fwierzbicki, zyasoft, jeff.allen, santa4nt, amit
2018-04-14 16:12:26psykiatrislinkissue2363 messages
2018-04-14 16:12:26psykiatriscreate