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.
This commit is contained in:
Ghostkeeper 2021-09-21 14:20:59 +02:00
parent 58f4d44694
commit 9ab41c062b
No known key found for this signature in database
GPG Key ID: 68F39EA88EEED5FF

View File

@ -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