From 9ab41c062bcba7622d6a50b9a13d69a9692a79d1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 21 Sep 2021 14:20:59 +0200 Subject: [PATCH] Handle encoding errors in back-up zips Seems to happen when there's files in there with badly-encoded characters in the file names. Fixes Sentry issue CURA-2S7. --- cura/Backups/Backup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cura/Backups/Backup.py b/cura/Backups/Backup.py index 02badedefa..90a354c0a3 100644 --- a/cura/Backups/Backup.py +++ b/cura/Backups/Backup.py @@ -206,6 +206,8 @@ class Backup: archive.extract(archive_filename, target_path) except (PermissionError, EnvironmentError): Logger.logException("e", f"Unable to extract the file {archive_filename} from the backup due to permission or file system errors.") + except UnicodeEncodeError: + Logger.error(f"Unable to extract the file {archive_filename} because of an encoding error.") CuraApplication.getInstance().processEvents() return True