File "/home/guthix/.local/lib/python3.6/site-packages/electrum/gui/qt/main_window.py", line 3171, in closeEvent
    self.clean_up()
  File "/home/guthix/.local/lib/python3.6/site-packages/electrum/gui/qt/main_window.py", line 3192, in clean_up
    self.gui_object.close_window(self)
  File "/home/guthix/.local/lib/python3.6/site-packages/electrum/gui/qt/__init__.py", line 286, in close_window
    self.daemon.stop_wallet(window.wallet.storage.path)
  File "/home/guthix/.local/lib/python3.6/site-packages/electrum/daemon.py", line 276, in stop_wallet
    wallet.stop_threads()
  File "/home/guthix/.local/lib/python3.6/site-packages/electrum/address_synchronizer.py", line 172, in stop_threads
    self.storage.write()
  File "/home/guthix/.local/lib/python3.6/site-packages/electrum/util.py", line 367, in <lambda>
    return lambda *args, **kw_args: do_profile(args, kw_args)
  File "/home/guthix/.local/lib/python3.6/site-packages/electrum/util.py", line 363, in do_profile
    o = func(*args, **kw_args)
  File "/home/guthix/.local/lib/python3.6/site-packages/electrum/storage.py", line 122, in write
    self._write()
  File "/home/guthix/.local/lib/python3.6/site-packages/electrum/storage.py", line 134, in _write
    with open(temp_path, "w", encoding='utf-8') as f: