Alexander Steppke <astep...@gmail.com> added the comment:

Thank you for the update Victor. It seems to me that this is exactly the same 
issue.

At the moment the current documentation says 
(http://docs.python.org/library/stdtypes.html#bltin-file-objects):

"Note: This function is simply a wrapper for the underlying fread() C function, 
and will behave the same in corner cases, such as whether the EOF value is 
cached."

This is a hint to the current behavior but I would not expect from this that 
file.read() can return any kind of data, if used directly after file.write(). 
Maybe one could include a link or a snippet of the C standard which states that 
one shall not do this:

"When a file is opened with update mode ('+' as the second or third character 
in the above list of mode argument values), both input and output may be 
performed on the associated stream. However, output shall not be directly 
followed by input without an intervening call to the fflush function or to a 
file positioning function (fseek, fsetpos, or rewind), and input shall not be 
directly followed by output without an
intervening call to a file positioning function, unless the input operation 
encounters end-of-file." 
 
(from http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf, page 272)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13171>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to