merge #5461: [cookies] use tempfile when saving cookies.txt files

pull/5479/head
Mike Fährmann 5 months ago
commit 0d72789aa3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -441,9 +441,11 @@ class Extractor():
if not path:
return
path_tmp = path + ".tmp"
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)

Loading…
Cancel
Save