Page MenuHomePhabricator

[electrum] Catch a potential LibUSB error during session close when jumping to bootloader
ClosedPublic

Authored by Fabien on Fri, Mar 21, 11:05.

Details

Summary

The issue exists some machines/OS/devices (still unclear) that libusb raises an error when the session is closed during a reboot to bootloader. Since this does not affect the upgrade process we can safely catch and ignore this error as a workaround.

Test Plan

Tested on a failing machine/os/device combination.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
electrum_libusb_session_close
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32796
Build 65080: Build Diffelectrum-tests
Build 65079: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Fri, Mar 21, 11:05
PiRK added a subscriber: PiRK.
PiRK added inline comments.
electrum/electrumabc_plugins/trezor/clientbase.py
362–371

for simple try: ... except SomeError: pass blocks I usually prefer with contexlib.suppress(SomeError): ...

But then the comment placement is less obvious.
Your call.

This revision is now accepted and ready to land.Fri, Mar 21, 11:21