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 steven.daprano
Recipients ngie, steven.daprano
Date 2019-02-25.22:33:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551134003.15.0.800749101559.issue36111@roundup.psfhosted.org>
In-reply-to
Content
I believe you will find that this is because you opened the file in text mode, which means Unicode, not bytes. If you open it in binary mode, the POSIX spec applies:

py> fp = open("sample", "rb"); fp.seek(-100, os.SEEK_END)
350

Supported values for seeking in text (Unicode) files are documented here:

https://docs.python.org/3/library/io.html#io.TextIOBase.seek

I don't believe this is a bug, or possible to be changed. Do you still think otherwise? If not, we should close this ticket.
History
Date User Action Args
2019-02-25 22:33:23steven.dapranosetrecipients: + steven.daprano, ngie
2019-02-25 22:33:23steven.dapranosetmessageid: <1551134003.15.0.800749101559.issue36111@roundup.psfhosted.org>
2019-02-25 22:33:23steven.dapranolinkissue36111 messages
2019-02-25 22:33:23steven.dapranocreate