Message364158
I tested is and it is not "state cookie" but it is "absolute position" and it is "stateless".
> The I/O stack in Python 3 does not use C FILE streams, and this issue is not related to Windows. TextIOWrapper.tell returns a "cookie" based on the decoder state:
I will study: https://github.com/python/cpython/blob/3.8/Modules/_io/textio.c#L2589 - Thank you for reference.
See this test code (wrong seek is good - decoder has not state before - first line of program).
You can swap this two fragments and it still works.
print('seek 18446744073709554618')
with open('../s01_parser_eval/data/out-6976.txt') as pgn:
pgn.seek(18446744073709554618)
while pgn.tell() != 3003:
pgn.readline()
print(pgn.tell())
print()
print('seek 0')
with open('../s01_parser_eval/data/out-6976.txt') as pgn:
pgn.seek(0)
while pgn.tell() != 18446744073709554618:
pgn.readline()
print(pgn.tell())
pgn.readline()
print('next', pgn.tell())
print('seek 18446744073709554618')
with open('../s01_parser_eval/data/out-6976.txt') as pgn:
pgn.seek(18446744073709554618)
while pgn.tell() != 3003:
pgn.readline()
print(pgn.tell())) |
|
Date |
User |
Action |
Args |
2020-03-14 12:59:34 | Cezary.Wagner | set | recipients:
+ Cezary.Wagner, tim.peters, paul.moore, eric.smith, tim.golden, zach.ware, eryksun, steve.dower |
2020-03-14 12:59:34 | Cezary.Wagner | set | messageid: <1584190774.4.0.97071853955.issue39962@roundup.psfhosted.org> |
2020-03-14 12:59:34 | Cezary.Wagner | link | issue39962 messages |
2020-03-14 12:59:34 | Cezary.Wagner | create | |
|