diff --git a/gui/qt/__init__.py b/gui/qt/__init__.py index 4c365366..4fe6e690 100644 --- a/gui/qt/__init__.py +++ b/gui/qt/__init__.py @@ -134,7 +134,7 @@ class ElectrumGui: try: storage = WalletStorage(filename) except Exception as e: - QMessageBox.information(None, _('Error'), str(e), _('OK')) + WindowModalDialog.warning(None, _('Error'), str(e)) return if not storage.file_exists: recent = self.config.get('recently_open', []) @@ -147,7 +147,7 @@ class ElectrumGui: wallet = Wallet(storage) except BaseException as e: traceback.print_exc(file=sys.stdout) - QMessageBox.warning(None, _('Warning'), str(e), _('OK')) + WindowModalDialog.warning(None, _('Warning'), str(e)) return action = wallet.get_action() # run wizard diff --git a/lib/wallet.py b/lib/wallet.py index b67320b9..6e0a950d 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -69,11 +69,11 @@ class WalletStorage(PrintError): except: try: d = ast.literal_eval(data) #parse raw data from reading wallet file + labels = d.get('labels', {}) except Exception as e: raise IOError("Cannot read wallet file '%s'" % self.path) self.data = {} # In old versions of Electrum labels were latin1 encoded, this fixes breakage. - labels = d.get('labels', {}) for i, label in labels.items(): try: unicode(label)