[issue36111] Negative `offset` values are no longer acceptable with implementation of `seek` with python3; should be per POSIX

Enji Cooper report at bugs.python.org
Mon Feb 25 17:42:10 EST 2019


Enji Cooper <yaneurabeya at gmail.com> added the comment:

?!

Being blunt: why should opening a file in binary vs text mode matter? POSIX doesn't make this distinction.

Per the pydoc (https://docs.python.org/2/library/functions.html#open):

> The default is to use text mode, which may convert '\n' characters to a platform-specific representation on writing and back on reading.

If this is one of the only differentiators between binary and text mode, why should certain types of seeking be made impossible?

Having to stat the file, then set the cursor to the size of the file, minus the offset breaks the 'seek(..)' interface, and having to use 'rb', then convert from bytes to unicode overly complicates things :(.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36111>
_______________________________________


More information about the Python-bugs-list mailing list