save cookies to tempfile, then rename
avoids wiping the cookies file if the disk is full
This commit is contained in:
@@ -431,8 +431,9 @@ class Extractor():
|
||||
return
|
||||
|
||||
try:
|
||||
with open(path, "w") as fp:
|
||||
with open(path + ".tmp", "w") as fp:
|
||||
util.cookiestxt_store(fp, self.cookies)
|
||||
os.replace(path + ".tmp", path)
|
||||
except OSError as exc:
|
||||
self.log.warning("cookies: %s", exc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user