Просмотр исходного кода

fix: remove unnecessary file mode in log line counting function

Manuel 2 месяцев назад
Родитель
Сommit
9f17c78d9f
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      parsers/log.py

+ 1 - 1
parsers/log.py

@@ -246,7 +246,7 @@ def _preview_log_line(line: str | None, max_chars: int = 180) -> str:
 
 def _count_lines(log_file: str) -> int:
     try:
-        with open(log_file, "r", encoding="utf-8", errors="replace") as file:
+        with open(log_file, encoding="utf-8", errors="replace") as file:
             return sum(1 for _ in file)
     except OSError as error:
         logger.warning("Unable to count lines in {}: {}", log_file, error)