PolicyStat / terrarium

Package and ship relocatable python virtualenvs, like a boss.
https://terrarium.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
171 stars 14 forks source link

Copy archive first to tempfile in same directory #63

Closed jwg4 closed 7 years ago

jwg4 commented 7 years ago

Leaving a partially-copied archive with the relevant name in the storage dir creates a problem since there is an archive present, so no new virtualenv is built, but it can't be used. We should first write to a temporary file in the same directory, then do os.rename() which is guaranteed to be atomic.

jlward commented 7 years ago

Hello jwg4,

Thank you for submitting a PR for this issue. Do you mind getting passing tests? This shows we have some failing tests. Other than that, the PR looks good, we'll try to get this merged in as soon as we can.

jwg4 commented 7 years ago

No problem. I saw the Travis build had failed but I haven't yet had time to fix it. Will do so and resubmit asap.

jlward commented 7 years ago

Looks good, thanks for the PR :)