Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Yes, the exact behaviour depends on multiple aspects.
You should follow the C library conventions: 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. """ In your case, I suggest a call to fp.seek(0, os.SEEK_CUR) before you start writing data. And a fp.flush() after, in case you want to read again. Python 3.0 has a completely new I/O implementation, which may have its own problems, but hopefully the same on all platforms. And it happens to do the right thing in your example. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3207> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com