diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 18cf0e3a..30eae7f0 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -430,10 +430,11 @@ class Extractor(): if not path: return + path_tmp = path + ".tmp" try: - with open(path + ".tmp", "w") as fp: + with open(path_tmp, "w") as fp: util.cookiestxt_store(fp, self.cookies) - os.replace(path + ".tmp", path) + os.replace(path_tmp, path) except OSError as exc: self.log.warning("cookies: %s", exc)