This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Alexander.Steppke
Recipients Alexander.Steppke, r.david.murray, vstinner
Date 2011-10-14.12:37:29
SpamBayes Score 2.2242458e-10
Marked as misclassified No
Message-id <1318595850.54.0.168885134496.issue13171@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2011-10-14 12:37:30Alexander.Steppkesetrecipients: + Alexander.Steppke, vstinner, r.david.murray
2011-10-14 12:37:30Alexander.Steppkesetmessageid: <1318595850.54.0.168885134496.issue13171@psf.upfronthosting.co.za>
2011-10-14 12:37:29Alexander.Steppkelinkissue13171 messages
2011-10-14 12:37:29Alexander.Steppkecreate