Related eBooks

I have a pull request thats struggling to get past linting.

Python's open(...) seems to be used to open text files without explicitly specifying encoding='utf8':

test/functional/feature_chain_arg_collision.py:        with open(
Success: no issues found in 251 source files
^---- failure generated from lint-python-utf8-encoding.py

Running the linter locally doesn’t trigger the error warning.

The only place I use open is in the functional test

with open(
             os.path.join(self.nodes[0].datadir, "bitcoin.conf"), "a", encoding="utf8"
         ) as conf:
             conf.write(f"includeconf={inc_conf_file_path}n")

         with open(inc_conf_file_path, "w", encoding="utf8") as conf:
             conf.write("chain=regtestn")

I’m running

/Users/${USER}/git/bitcoin/test/lint/lint-python-utf8-encoding.py

with my file staged in git.

source

By pplny

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

Translate »