diff --git a/scripts/rtl_ltr_linter.py b/scripts/rtl_ltr_linter.py index 70e52a798..c935bcf92 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