Allow packing to ZIP files

This commit is contained in:
Sybren A. Stüvel
2018-03-22 10:06:48 +01:00
parent e53470d898
commit 8d1bd89583
6 changed files with 118 additions and 13 deletions
+8
View File
@@ -181,3 +181,11 @@ class FileTransferer(threading.Thread, metaclass=abc.ABCMeta):
# Since Thread.join() neither returns anything nor raises any exception
# when timing out, we don't even have to call it any more.
def delete_file(self, path: pathlib.Path):
"""Deletes a file, only logging a warning if deletion fails."""
log.debug('Deleting %s, file has been transferred', path)
try:
path.unlink()
except IOError as ex:
log.warning('Unable to delete %s: %s', path, ex)