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 socketpair
Recipients ezio.melotti, martin.panter, pitrou, r.david.murray, socketpair, vstinner
Date 2015-12-16.22:59:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450306766.2.0.540948824943.issue25849@psf.upfronthosting.co.za>
In-reply-to
Content
Seems this object should also incapsulate weakref to opened file... (to prevent using it on another text file)

* after writing, all objects, that incapsulate offset > current (during start of write()) should become invalid.
* truncate(arg) should also make that objects invalid for offsets > arg


One bad thing: seeking to the end of file is not safe:
If someone opens logfile, last byte in that text file may belong to middle of multibyte sequence. This really may happen, since Linux (libc) writes files page-by-page (if not line-buffered), so if page boundary is inside character, this bad thing may happen. Real case - is implementing something like `tail -f` in python (to, say, monitor log files).

So, seeking to the end of file is also wrong, and should be disallowed. If so, how to append text to text files ? very upset :( :( I don't know decision of that problem.
History
Date User Action Args
2015-12-16 22:59:26socketpairsetrecipients: + socketpair, pitrou, vstinner, ezio.melotti, r.david.murray, martin.panter
2015-12-16 22:59:26socketpairsetmessageid: <1450306766.2.0.540948824943.issue25849@psf.upfronthosting.co.za>
2015-12-16 22:59:26socketpairlinkissue25849 messages
2015-12-16 22:59:25socketpaircreate