Skip to content

Commit fa3d729

Browse files
author
MarcoFalke
committed
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: """
1 parent fa6bb85 commit fa3d729

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/lint/lint-python-utf8-encoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def check_fileopens():
2828
if e.returncode > 1:
2929
raise e
3030

31-
filtered_fileopens = [fileopen for fileopen in fileopens if not re.search(r"encoding=.(ascii|utf8|utf-8).|open\([^,]*, ['\"][^'\"]*b[^'\"]*['\"]", fileopen)]
31+
filtered_fileopens = [fileopen for fileopen in fileopens if not re.search(r"encoding=.(ascii|utf8|utf-8).|open\([^,]*, (\*\*kwargs|['\"][^'\"]*b[^'\"]*['\"])", fileopen)]
3232

3333
return filtered_fileopens
3434

0 commit comments

Comments
 (0)