This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Cezary.Wagner
Recipients Cezary.Wagner, eric.smith, eryksun, paul.moore, steve.dower, tim.golden, tim.peters, zach.ware
Date 2020-03-14.12:59:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584190774.4.0.97071853955.issue39962@roundup.psfhosted.org>
In-reply-to
Content
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()))
History
Date User Action Args
2020-03-14 12:59:34Cezary.Wagnersetrecipients: + Cezary.Wagner, tim.peters, paul.moore, eric.smith, tim.golden, zach.ware, eryksun, steve.dower
2020-03-14 12:59:34Cezary.Wagnersetmessageid: <1584190774.4.0.97071853955.issue39962@roundup.psfhosted.org>
2020-03-14 12:59:34Cezary.Wagnerlinkissue39962 messages
2020-03-14 12:59:34Cezary.Wagnercreate