Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
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. ---------- nosy: +steven.daprano _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36111> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com