diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-07-06 16:07:20 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-07-20 09:15:43 +0200 |
commit | fa3d72960bc86319aa8b838e3df4e833f845c71f (patch) | |
tree | ddb76d61aa4c8dcee28d1b242c8c1bd35d0c283e | |
parent | fa6bb85cd264adf2e1f0c71fa97b650f9a62745f (diff) |
lint: Ignore check_fileopens failure on **kwargs
This fixes a bug in the linter:
"""
Python's open(...) seems to be used to open text files without explicitly specifying encoding='utf8':
test/functional/test_framework/test_node.py: with open(self.debug_log_path, **kwargs) as dl:
"""
-rwxr-xr-x | test/lint/lint-python-utf8-encoding.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/lint/lint-python-utf8-encoding.py b/test/lint/lint-python-utf8-encoding.py index 64d04bff57..8c9266470f 100755 --- a/test/lint/lint-python-utf8-encoding.py +++ b/test/lint/lint-python-utf8-encoding.py @@ -28,7 +28,7 @@ def check_fileopens(): if e.returncode > 1: raise e - filtered_fileopens = [fileopen for fileopen in fileopens if not re.search(r"encoding=.(ascii|utf8|utf-8).|open\([^,]*, ['\"][^'\"]*b[^'\"]*['\"]", fileopen)] + filtered_fileopens = [fileopen for fileopen in fileopens if not re.search(r"encoding=.(ascii|utf8|utf-8).|open\([^,]*, (\*\*kwargs|['\"][^'\"]*b[^'\"]*['\"])", fileopen)] return filtered_fileopens |