From 3a8106b598b27fa6a3d5d3c90c330bc3ef6bebb9 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Sun, 25 May 2025 12:05:11 +0200 Subject: [PATCH] scripts: logging: dictionary: utils: Fix redundant open flags Fix issue reported by ruff. Signed-off-by: Pieter De Gendt --- .ruff-excludes.toml | 3 --- scripts/logging/dictionary/dictionary_parser/utils.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.ruff-excludes.toml b/.ruff-excludes.toml index 201f44a7d9e..80b204f5c4d 100644 --- a/.ruff-excludes.toml +++ b/.ruff-excludes.toml @@ -568,9 +568,6 @@ "UP036", # https://docs.astral.sh/ruff/rules/outdated-version-block "UP038", # https://docs.astral.sh/ruff/rules/non-pep604-isinstance ] -"./scripts/logging/dictionary/dictionary_parser/utils.py" = [ - "UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes -] "./scripts/logging/dictionary/log_parser.py" = [ "SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler "UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes diff --git a/scripts/logging/dictionary/dictionary_parser/utils.py b/scripts/logging/dictionary/dictionary_parser/utils.py index 33a126261ba..c6ad4f2a9ff 100644 --- a/scripts/logging/dictionary/dictionary_parser/utils.py +++ b/scripts/logging/dictionary/dictionary_parser/utils.py @@ -15,7 +15,7 @@ def convert_hex_file_to_bin(hexfile): """This converts a file in hexadecimal to binary""" bin_data = b'' - with open(hexfile, "r", encoding="iso-8859-1") as hfile: + with open(hexfile, encoding="iso-8859-1") as hfile: for line in hfile.readlines(): hex_str = line.strip()