[issue5541] File's current position inconsistent with 'a+' mode

Lukas Lueg report at bugs.python.org
Mon Mar 23 09:26:24 CET 2009


New submission from Lukas Lueg <knabberknusperhaus at yahoo.de>:

The file pointer's behaviour after opening a file in 'a+b' mode is not
consistent among platforms: The pointer is set to the beginning of the
file on Linux and to the end of the file on MacOS. You have to call
.seek(0) before calling .read() to get consistent behaviour on all
platforms.

While this is not a serious problem, it somewhat violates the rule of
least surprise. Also we are not bound to this behaviour and can make
sure that all file objects have their respective positions well-defined
after object-creation.

Thoughts?

----------
messages: 83997
nosy: ebfe
severity: normal
status: open
title: File's current position inconsistent with 'a+' mode
versions: Python 2.5

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


More information about the Python-bugs-list mailing list