Philipp Hörist pushed to branch master at gajim / gajim


Commits:
53ea0175 by Philipp Hörist at 2023-11-07T18:45:58+01:00
imprv: HTTPUpload: Remove temporary files after transfer

Fixes #11579

- - - - -


1 changed file:

- gajim/common/modules/httpupload.py


Changes:

=====================================
gajim/common/modules/httpupload.py
=====================================
@@ -440,9 +440,11 @@ def set_error(self, domain: str, text: str = '') -> None:
             text = self._errors[domain]
 
         super().set_error(domain, text)
+        self._cleanup()
 
     def set_finished(self) -> None:
         super().set_finished()
+        self._cleanup()
 
     def set_encrypted_data(self, data: bytes) -> None:
         self._temp_path.write_bytes(data)
@@ -455,3 +457,7 @@ def process_result(self, result: HTTPUploadData) -> None:
         self.put_uri = result.put_uri
         self.get_uri = result.get_uri
         self._headers = result.headers
+
+    def _cleanup(self) -> None:
+        if self._temp_path.exists():
+            self._temp_path.unlink()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/53ea01750298fe6d95fa02b41cd60ec460bdd667

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/53ea01750298fe6d95fa02b41cd60ec460bdd667
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to