From 7c8153eedea6b98f9d83e45dbb285ed81b5275bc Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Wed, 11 Aug 2021 17:25:45 +0200 Subject: [PATCH] Don't crash if the keyring password cannot be decoded Fixes Sentry issue CURA-2S0 --- cura/OAuth2/KeyringAttribute.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/OAuth2/KeyringAttribute.py b/cura/OAuth2/KeyringAttribute.py index 9bb6e3c267..b8864e31e0 100644 --- a/cura/OAuth2/KeyringAttribute.py +++ b/cura/OAuth2/KeyringAttribute.py @@ -43,6 +43,10 @@ class KeyringAttribute: self._store_secure = False Logger.log("i", "Access to the keyring was denied.") return getattr(instance, self._name) + except UnicodeDecodeError: + self._store_secure = False + Logger.log("w", "The password retrieved from the keyring cannot be used because it contains characters that cannot be decoded.") + return getattr(instance, self._name) else: return getattr(instance, self._name)