[issue6390] File reads past EOF in "w+b" mode

Amaury Forgeot d'Arc report at bugs.python.org
Tue Jun 30 19:11:47 CEST 2009


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Yes, see the discussion in issue3207, specially this part:

http://www.cplusplus.com/reference/clibrary/cstdio/fopen.html
"""
For the modes where both read and writing (or appending) are allowed
(those which include a "+" sign), the stream should be flushed (fflush)
or repositioned (fseek, fsetpos, rewind) between either a reading
operation followed by a writing operation or a writing operation
followed by a reading operation.
"""

Python 2.x relies on the fopen functions to implement files, and
inherits this behavior.
Python 3.x has a completely new implementation and doesn't have this
problem.

----------
nosy: +amaury.forgeotdarc
resolution:  -> wont fix
status: open -> closed

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


More information about the Python-bugs-list mailing list