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 gregory.p.smith
Recipients Arfrever, benjamin.peterson, danieljewell, eric.snow, flox, georg.brandl, gregory.p.smith, iMath, larry, ncoghlan, python-dev, serhiy.storchaka, stutzbach, superluser, tulir
Date 2020-09-14.16:53:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600102439.68.0.338777315635.issue19081@roundup.psfhosted.org>
In-reply-to
Content
On POSIX systems, keeping the file open means you will keep a handle to the original file in the case where something moves a new file into it's place (as is normal during software package updates) or otherwise unlinks the original.  That is the situation that led to filing this issue and is one that is technically solvable by keeping the file handle open and always using that for access.

We can't do anything very meaningful about someone opening the existing file in 'w+a' mode and scribbling other bytes over it.  I wouldn't try to protect against that.  "locking" a file isn't an option on most platforms and when available, is very unusual to do in this century.
History
Date User Action Args
2020-09-14 16:53:59gregory.p.smithsetrecipients: + gregory.p.smith, georg.brandl, ncoghlan, larry, benjamin.peterson, stutzbach, Arfrever, flox, python-dev, eric.snow, serhiy.storchaka, superluser, iMath, tulir, danieljewell
2020-09-14 16:53:59gregory.p.smithsetmessageid: <1600102439.68.0.338777315635.issue19081@roundup.psfhosted.org>
2020-09-14 16:53:59gregory.p.smithlinkissue19081 messages
2020-09-14 16:53:59gregory.p.smithcreate