electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit c0a42b756be0494e3b45d539f68c0f5269c858de
parent a00439b6f8a6507a142d7b5b29a793d340a183a9
Author: SomberNight <somber.night@protonmail.com>
Date:   Thu, 22 Mar 2018 08:18:27 +0100

fix #4159

Diffstat:
Mgui/qt/main_window.py | 12++++++++++--
Mlib/simple_config.py | 4++++
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -396,7 +396,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.show_warning(msg, title=_('Information')) def open_wallet(self): - wallet_folder = self.get_wallet_folder() + try: + wallet_folder = self.get_wallet_folder() + except FileNotFoundError as e: + self.show_error(str(e)) + return filename, __ = QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder) if not filename: return @@ -440,7 +444,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): return os.path.dirname(os.path.abspath(self.config.get_wallet_path())) def new_wallet(self): - wallet_folder = self.get_wallet_folder() + try: + wallet_folder = self.get_wallet_folder() + except FileNotFoundError as e: + self.show_error(str(e)) + return i = 1 while True: filename = "wallet_%d" % i diff --git a/lib/simple_config.py b/lib/simple_config.py @@ -233,6 +233,10 @@ class SimpleConfig(PrintError): return path # default path + if not os.path.exists(self.path): + raise FileNotFoundError( + _('Electrum datadir does not exist. Was it deleted while running?') + '\n' + + _('Should be at {}').format(self.path)) dirpath = os.path.join(self.path, "wallets") if not os.path.exists(dirpath): if os.path.islink(dirpath):