From 87b6fc0afe413417a53be6d6e20669e1f9efe5cc Mon Sep 17 00:00:00 2001 From: haeussma <83341109+haeussma@users.noreply.github.com> Date: Fri, 25 Oct 2024 21:07:28 +0200 Subject: [PATCH] Refactor file reading in AgilentRDLReader to specify UTF-8 encoding --- chromatopy/readers/agilent_rdl.py | 2 +- chromatopy/tools/analyzer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chromatopy/readers/agilent_rdl.py b/chromatopy/readers/agilent_rdl.py index e37115e..bd71268 100644 --- a/chromatopy/readers/agilent_rdl.py +++ b/chromatopy/readers/agilent_rdl.py @@ -48,7 +48,7 @@ def read(self): @staticmethod def read_file(file_path: str) -> list[str]: - with open(file_path, "r") as file: + with open(file_path, "r", encoding="utf-8") as file: lines = file.readlines() return lines diff --git a/chromatopy/tools/analyzer.py b/chromatopy/tools/analyzer.py index e8e6335..59db731 100644 --- a/chromatopy/tools/analyzer.py +++ b/chromatopy/tools/analyzer.py @@ -527,7 +527,7 @@ def read_agilent( found_lines = "found no startswith ┌─────" except UnicodeDecodeError: error = "UnicodeDecodeError" - txt_paths = txt_paths + except StopIteration: error = "StopIteration" txt_paths = txt_paths