SomberNight 2 years ago
parent
commit
7c2131209f
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/simple_config.py

6
electrum/simple_config.py

@ -416,8 +416,10 @@ class SimpleConfig(Logger):
with open(path, "w", encoding='utf-8') as f: with open(path, "w", encoding='utf-8') as f:
f.write(s) f.write(s)
os_chmod(path, stat.S_IREAD | stat.S_IWRITE) os_chmod(path, stat.S_IREAD | stat.S_IWRITE)
except FileNotFoundError: except OSError:
# datadir probably deleted while running... # datadir probably deleted while running... e.g. portable exe running on ejected USB drive
# (in which case it is typically either FileNotFoundError or PermissionError,
# but let's just catch the more generic OSError and test explicitly)
if os.path.exists(self.path): # or maybe not? if os.path.exists(self.path): # or maybe not?
raise raise

Loading…
Cancel
Save