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 vstinner
Recipients Arfrever, caitlinwalker37, docs@python, eryksun, georg.brandl, nicksjacobson, pitrou, steve.dower, tim.golden, vstinner, zach.ware
Date 2017-01-26.08:08:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485418115.67.0.801853687146.issue22651@psf.upfronthosting.co.za>
In-reply-to
Content
On Python 2, it's easy to workaround the issue, just always go the end explicitly:

   f = open(filename, "a+")
   f.seek(0, os.SEEK_END)

Or use the io module which doesn't use the stdio of the C library and has a portable and reliable behaviour:

   f = io.open(filename, "a+")


Georg Brandl: "This is a somewhat unfortunate difference between the major C libs and Python's new IO, but probably too late to change."

Since it's easy to workaround the issue and only one user complained lat 2 years (3 years?), sorry, I close now the issue.

I add this bug to my long list of bugs in the C stdio which won't be fixed in Python 2...
http://haypo-notes.readthedocs.io/python.html#bugs-in-the-c-stdio-used-by-the-python-i-o
History
Date User Action Args
2017-01-26 08:08:35vstinnersetrecipients: + vstinner, georg.brandl, pitrou, tim.golden, Arfrever, docs@python, zach.ware, eryksun, steve.dower, nicksjacobson, caitlinwalker37
2017-01-26 08:08:35vstinnersetmessageid: <1485418115.67.0.801853687146.issue22651@psf.upfronthosting.co.za>
2017-01-26 08:08:35vstinnerlinkissue22651 messages
2017-01-26 08:08:35vstinnercreate