diff --git a/scripts/rtl_ltr_linter.py b/scripts/rtl_ltr_linter.py index 8c990c971..e8e5d7ad8 100644 --- a/scripts/rtl_ltr_linter.py +++ b/scripts/rtl_ltr_linter.py @@ -210,7 +210,8 @@ def lint_file(path, cfg): # Try to read the file content and handle potential errors try: - lines = open(path, encoding='utf-8').read().splitlines() + with open(path, encoding='utf-8') as f: + lines = f.read().splitlines() except Exception as e: return [f"::error file={path},line=1::Cannot read file: {e}"] # Return as a list of issues