E.g. on Windows, files open in one process cannot be deleted by another process.
With file logging enabled, if an old logfile was open in a text editor,
Electrum could crash during startup.
```
E | __main__ |
Traceback (most recent call last):
File "...\electrum\run_electrum", line 391, in main
handle_cmd(
File "...\electrum\run_electrum", line 403, in handle_cmd
configure_logging(config)
File "...\electrum\electrum\logging.py", line 278, in configure_logging
_configure_file_logging(log_directory)
File "...\electrum\electrum\logging.py", line 107, in _configure_file_logging
_delete_old_logs(log_directory)
File "...\electrum\electrum\logging.py", line 98, in _delete_old_logs
os.remove(str(f))
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '...\\AppData\\Roaming\\Electrum\\testnet\\logs\\electrum_log_20210414T023751Z_25008.log'
```
fixes#7198
We recently bumped the bundled version of PyQt (5.14.2->5.15.4).
It seems the new version has a lot more dynamic dependencies.
From https://doc.qt.io/qt-5/linux-requirements.html :
> From Qt 5.15 onwards, Qt does require libxcb 1.11. Also, the -qt-xcb
> configure option got removed that was bundling some of the libs below.
We are using the prebuilt wheels for PyQt5 from PyPI. Presumably those
had previously been built using the -qt-xcb option.
In some places in the script if some directory name had spaces it could cause issues.
I also added quotes around a few other directory names that currently are hardcoded with names without spaces as a way to prevent any future mishap
Adds liquidity hints for the sending capabilities of routing channels in the
graph. The channel blacklist is incorporated into liquidity hints.
Liquidity hints are updated when a payment fails with a temporary
channel failure or when it succeeds. Liquidity hints are used to give a
penalty in the _edge_cost heuristics used by the pathfinding algorithm.
The base penalty in (_edge_cost) is removed because it is now part of the
liquidity penalty. We don't return early from get_distances, as we want
to explore all channels.
Note that clicking "x" to close the wizard or pressing ESC also raises
a UserCancelled:
raising ChooseHwDeviceAgain was not letting the wizard close.
E | gui.qt.installwizard.InstallWizard |
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/base_wizard.py", line 371, in on_device
client = self.plugin.setup_device(device_info, self, purpose)
File "/home/user/wspace/electrum/electrum/plugins/trezor/trezor.py", line 305, in setup_device
self.initialize_device(device_id, wizard, client.handler)
File "/home/user/wspace/electrum/electrum/plugins/trezor/trezor.py", line 231, in initialize_device
wizard.choice_dialog(title=_('Initialize Device'), message=msg, choices=choices, run_next=f)
File "/home/user/wspace/electrum/electrum/gui/qt/installwizard.py", line 106, in func_wrapper
out = func(*args, **kwargs)
File "/home/user/wspace/electrum/electrum/gui/qt/installwizard.py", line 614, in choice_dialog
self.exec_layout(vbox, title)
File "/home/user/wspace/electrum/electrum/gui/qt/installwizard.py", line 434, in exec_layout
raise UserCancelled()
electrum.util.UserCancelled
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/base_wizard.py", line 277, in choose_hw_device
self._choose_hw_device(purpose=purpose, storage=storage)
File "/home/user/wspace/electrum/electrum/base_wizard.py", line 363, in _choose_hw_device
self.choice_dialog(title=title, message=msg, choices=choices,
File "/home/user/wspace/electrum/electrum/gui/qt/installwizard.py", line 120, in func_wrapper
run_next(*out)
File "/home/user/wspace/electrum/electrum/base_wizard.py", line 364, in <lambda>
run_next=lambda *args: self.on_device(*args, purpose=purpose, storage=storage))
File "/home/user/wspace/electrum/electrum/base_wizard.py", line 386, in on_device
raise ChooseHwDeviceAgain()
electrum.base_wizard.ChooseHwDeviceAgain
E | gui.qt.installwizard.InstallWizard | choose_hw_device(). while iter starts.
I | plugin.DeviceMgr | scanning devices...
If you force-show a widget (e.g. `w.setVisible(True)`) before parenting it,
a small window will flash (appear and disappear) for a fraction of second,
which is a bit irritating.
There is gui.stop() already, which does the same thing (which is shared API with kivy).
Also, the _cleanup_before_exit() call was redundant in close(),
aboutToQuit handles that.
related: https://github.com/spesmilo/electrum/issues/6889
This fixes the case where the user quits by pressing Ctrl+C,
and some other minor things.
There is still another issue that sometimes causes a segfault during shutdown...