Page MenuHomePhabricator

[electrum] remove winconsole
ClosedPublic

Authored by PiRK on Jun 27 2023, 12:48.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCb62bbb97ea11: [electrum] remove winconsole
Summary

The rationale for adding this was to make Electron Cash work from the command line on Windows, which is a niche user-case for developers trying to troubleshoot issues by running the application in verbose mode (-v). This didn't work from the default Windows command line. But it does work when running it using a more sophisticated command line such as Git Bash.

The rationale for removing it is that the recent bumping of dependency versions broke the windows ...setup.exe version of the binary because of a bug with the latest versions of psutil (after 5.8.0) when run via PyInstaller. An alternative to removing that feature would be to downgrade psutil from 5.9.4 to 5.8.0. But the use case for the feature seems marginal enough that removing it seems preferable. This has the added benefit of removing a problematic dependency and some hard to maintain/test code.

For future reference, the issue with psutil is:

Traceback (most recent call last):
  File "electrumabc\winconsole.py", line 46, in parent_process_pids
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "psutil\__init__.py", line 241, in <module>
ImportError: version conflict: 'C:\\Program Files (x86)\\Electrum ABC\\psutil\\_psutil_windows.cp39-win32.pyd' C extension module was built for another version of psutil (5.8.0 instead of 5.9.5); you may try to 'pip uninstall psutil', manually remove C:\Program Files (x86)\Electrum ABC\psutil\_psutil_windows.cp39-win32.pyd or clean the virtual env somehow, then reinstall

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "electrum-abc", line 641, in <module>
  File "electrum-abc", line 587, in main
  File "electrumabc\winconsole.py", line 107, in create_or_attach_console
  File "electrumabc\winconsole.py", line 52, in parent_process_pids
UnboundLocalError: local variable 'psutil' referenced before assignment
Test Plan

Run tests

Build for windows and test the installer (*-setup.exe) then run Electrum ABC from the command line with Git Bash (with and without -v)

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable