tfix #4129 - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 36d52dfd5a60eba1469d08478d17ea713517ae0d DIR parent 22061b4555d4e038a2e783fa5de7efef4b7e06bc HTML Author: SomberNight <somber.night@protonmail.com> Date: Mon, 19 Mar 2018 01:04:02 +0100 fix #4129 Diffstat: M lib/simple_config.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- DIR diff --git a/lib/simple_config.py b/lib/simple_config.py t@@ -211,9 +211,14 @@ class SimpleConfig(PrintError): return path = os.path.join(self.path, "config") s = json.dumps(self.user_config, indent=4, sort_keys=True) - with open(path, "w") as f: - f.write(s) - os.chmod(path, stat.S_IREAD | stat.S_IWRITE) + try: + with open(path, "w") as f: + f.write(s) + os.chmod(path, stat.S_IREAD | stat.S_IWRITE) + except FileNotFoundError: + # datadir probably deleted while running... + if os.path.exists(self.path): # or maybe not? + raise def get_wallet_path(self): """Set the path of the wallet."""