[issue12843] file object read* methods in append mode overflows

Amaury Forgeot d'Arc report at bugs.python.org
Mon Aug 29 00:02:21 CEST 2011


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

You should call the .flush() method when switching from writes to reads.

Nothing really overflows, but the fread() function may return uninitialized memory.  In versions 2.x, python uses the fopen, fread and fwrite function (from the C library) and is subject to their limitations.

The exact behaviour is undefined, and it is well possible that it only happens on Windows.  See also the discussion in #7952.

This issue does not exist in versions 3.x, where file functions have been rewritten.

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

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


More information about the Python-bugs-list mailing list