[issue5008] Wrong tell() result for a file opened in append mode

Antoine Pitrou report at bugs.python.org
Tue Jan 20 12:40:45 CET 2009


Antoine Pitrou <pitrou at free.fr> added the comment:

Comments on the patch:
- you should check the error return of lseek() (and possibly wrap it in
Py_BEGIN/END_ALLOW_THREADS, see portable_lseek() in the same file)
- there should be a test for each of unbuffered IO (buffering=0),
buffered IO ("rb") and text IO ("r"). For text IO, the test shouldn't
test the actual value returned by tell(), only that it is > 0 (because
tell() in text mode is an opaque value and is not necessarily equal to a
byte position)

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5008>
_______________________________________


More information about the Python-bugs-list mailing list