Message11890
I have added a patch for the test_fileseek.py to add a test reversing
the readline/red.
What I relized is while the read buffer may be larger, the readline
reads to the newline. Since the newline is at the 101st position in the
test.log, it apparently skewing the results. if you reverse it, run
readline() first, then read(), then the results are correct. Here is my
output for both:
2nd patch fixes results. I had a couple of prints backwards. But the
final result is below:
========
--Result of read--
File position: 1024 <-- read limit
Amount to seek back: -200
New position: 824
Correct position!
--- Result of readline() ---
File position: 101 <-- includes NEWLINE
Amount to seek back: -100
New position in file: 200
Wrong position
--- Result of both() ---
File position from read(): 4202
File position from readline(): 101
Amount to seek back: -100
New position in file: 4201
Wrong position
--- Result of both_reversed() ---
File position from readline(): 101
File position from read(): 1125
Amount to seek back: -100
New position in file: 1025
Correct position
On 04/06/2018 06:51 AM, Patrick Palczewski wrote:
> Patrick Palczewski <psykiatris@gmail.com> added the comment:
> |
|
Date |
User |
Action |
Args |
2018-04-11 05:24:00 | psykiatris | set | recipients:
+ psykiatris, fwierzbicki, zyasoft, tuck182, santa4nt, amit |
2018-04-11 05:24:00 | psykiatris | link | issue2363 messages |
2018-04-11 05:24:00 | psykiatris | create | |
|