Page MenuHomePhabricator

[electrum] add missing encodings to open() calls and enable linter
ClosedPublic

Authored by PiRK on Jun 23 2023, 15:12.

Details

Summary

As per title

Test Plan
arc lint --everything
cd electrum
python -m electrumabc.tests

Build for windows and run from command line with arg -v (to test the winconsole encoding)
Try also wine dist/ElectrumABC-5.2.4.exe -v on linux.

Diff Detail

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

Event Timeline

PiRK edited the test plan for this revision. (Show Details)
PiRK published this revision for review.Jun 23 2023, 17:00
Fabien requested changes to this revision.Jun 24 2023, 15:00
Fabien added a subscriber: Fabien.

Please keep the code consistent and choose between utf8 and utf-8, but don't randomly use one or the other

electrum/electrumabc/blockchain.py
317 ↗(On Diff #40955)

Most of the changes here are unrelated to the diff, and are very debatable. Please don't mix in refactors like this

This revision now requires changes to proceed.Jun 24 2023, 15:00
electrum/electrumabc/blockchain.py
317 ↗(On Diff #40955)

OK, I will revert this. My problem with the existing code is that open(self.path(), "wb").close() is very misleading and didn't make sense to me at first glance, until I understood that self is not what I expected it to be and that we actually create a new file.

consistently use "utf-8" everywhere (in the touched code), revert unrelated change

This revision is now accepted and ready to land.Jun 27 2023, 07:02