diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-11-07 20:45:58 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-11-07 20:45:58 +0300 |
commit | 53ea01750298fe6d95fa02b41cd60ec460bdd667 (patch) | |
tree | 0ceb3dcec88b4b51ea346f68fdabfe8e26454365 | |
parent | f3baca3c34c79b74f6535ead13fc1666b398b2b0 (diff) |
imprv: HTTPUpload: Remove temporary files after transfer
Fixes #11579
-rw-r--r-- | gajim/common/modules/httpupload.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gajim/common/modules/httpupload.py b/gajim/common/modules/httpupload.py index 5284974aa..ebf4afaa8 100644 --- a/gajim/common/modules/httpupload.py +++ b/gajim/common/modules/httpupload.py @@ -440,9 +440,11 @@ class HTTPFileTransfer(FileTransfer): 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 @@ class HTTPFileTransfer(FileTransfer): 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() |