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, brett.cannon, neologix, pitrou, python-dev, vinay.sajip, vstinner
Date 2011-11-02.22:10:00
SpamBayes Score 1.6909252e-11
Marked as misclassified No
Message-id <1320271801.5.0.20100041243.issue13303@psf.upfronthosting.co.za>
In-reply-to
Content
> 3) Fall back to the original ".tmp" suffix (with the risk
> of stale tmp file).

I missed something, what is the "stale tmp file" issue? Python/import.c uses:

    (void) unlink(filename);
    fd = open(filename, O_EXCL|O_CREAT|O_WRONLY|O_TRUNC ...);

So Python starts by removing the .tmp file, but it fails if another process is already writing into the .tmp file. In this case, we do nothing, which is not a problem: the other process will create the file.

Attached patch implements the same algorithm than import.c in importlib.
History
Date User Action Args
2011-11-02 22:10:01vstinnersetrecipients: + vstinner, brett.cannon, vinay.sajip, pitrou, Arfrever, neologix, python-dev
2011-11-02 22:10:01vstinnersetmessageid: <1320271801.5.0.20100041243.issue13303@psf.upfronthosting.co.za>
2011-11-02 22:10:00vstinnerlinkissue13303 messages
2011-11-02 22:10:00vstinnercreate