1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-08-18 12:49:38 +02:00

Fixed issue #769 by using os.replace instead os.rename (#775)

This commit is contained in:
lapourgagner 2020-08-17 18:17:23 +02:00 committed by GitHub
parent 57393f619d
commit 6f57197afb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -487,7 +487,7 @@ class InstaloaderContext:
shutil.copyfileobj(resp.raw, file)
else:
file.write(resp)
os.rename(filename + '.temp', filename)
os.replace(filename + '.temp', filename)
def get_raw(self, url: str, _attempt=1) -> requests.Response:
"""Downloads a file anonymously.