HomePhabricator

Fix detection of binary open() calls in the Python encoding linter

Description

Fix detection of binary open() calls in the Python encoding linter

Summary:
Currently, the python file encoding linter incorrectly identifies some cases of open() needing an encoding explicitly set when they in fact do not.
Reading/writing binary files should not set an encoding, so this false positive lint message will lead the developer to produce incorrect code
if the message is to be believed.

This patch fixes the pattern matching for binary-mode open() calls, which will allow the buildbot code to be ported to this repository
without breaking the linter.

Test Plan:

arc lint --everything

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7326

Details

Provenance
jasonbcoxAuthored on Sep 3 2020, 22:00
abc-botPushed on Sep 3 2020, 22:05
Reviewer
Restricted Project
Differential Revision
D7326: Fix detection of binary open() calls in the Python encoding linter
Parents
rABCe70d784e4bd3: [backport#15426] [Doc] importmulti: add missing description of keypool option
Branches
Unknown
Tags
Unknown