Message146877
> 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. |
|
Date |
User |
Action |
Args |
2011-11-02 22:10:01 | vstinner | set | recipients:
+ vstinner, brett.cannon, vinay.sajip, pitrou, Arfrever, neologix, python-dev |
2011-11-02 22:10:01 | vstinner | set | messageid: <1320271801.5.0.20100041243.issue13303@psf.upfronthosting.co.za> |
2011-11-02 22:10:00 | vstinner | link | issue13303 messages |
2011-11-02 22:10:00 | vstinner | create | |
|