From da0bef3a1ef2a887a9eae879da75241683d6fb54 Mon Sep 17 00:00:00 2001 From: "Lanzrath, Hannah" Date: Mon, 26 May 2025 11:06:08 +0200 Subject: [PATCH 1/2] Explicitly use utf-8 in write_lines_to_file --- cadetrdm/io_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cadetrdm/io_utils.py b/cadetrdm/io_utils.py index af0962e..2b56f47 100644 --- a/cadetrdm/io_utils.py +++ b/cadetrdm/io_utils.py @@ -34,12 +34,12 @@ def write_lines_to_file(path, lines, open_type="a"): add_initial_linebreak = False if os.path.exists(path) and open_type == "a": - with open(path, "r") as f: + with open(path, "r", encoding="utf-8") as f: existing_lines = f.readlines() if len(existing_lines) > 0 and not existing_lines[-1].endswith("\n"): add_initial_linebreak = True - with open(path, open_type) as f: + with open(path, open_type, encoding="utf-8") as f: f.writelines(add_linebreaks(lines, initial_linebreak=add_initial_linebreak)) From 44682dd3ef26e372931e4798d7b301938b74f8b7 Mon Sep 17 00:00:00 2001 From: "Lanzrath, Hannah" Date: Mon, 26 May 2025 11:15:59 +0200 Subject: [PATCH 2/2] Fix CI run on PR The CI didn't work on some new PRs due to the use of an old actions tag --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1f627fb..6f9676a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4