From bc2be74b3623b64b75571af0d95d519fe250f3b2 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 2 Jan 2026 12:20:09 +0000 Subject: [PATCH] fix: further fixes for utf8 reading on windows --- tests/rpc/test_rpc_apiserver.py | 4 +++- tests/test_strategy_updater.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index f7f99f288..0aad24602 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -2496,7 +2496,9 @@ def test_api_strategy(botclient, tmp_path, mocker): assert_response(rc) assert rc.json()["strategy"] == CURRENT_TEST_STRATEGY - data = (Path(__file__).parents[1] / "strategy/strats/strategy_test_v3.py").read_text() + data = (Path(__file__).parents[1] / "strategy/strats/strategy_test_v3.py").read_text( + encoding="utf-8" + ) assert rc.json()["code"] == data rc = client_get(client, f"{BASE_URI}/strategy/NoStrat") diff --git a/tests/test_strategy_updater.py b/tests/test_strategy_updater.py index 48f1d27d7..3c53f425e 100644 --- a/tests/test_strategy_updater.py +++ b/tests/test_strategy_updater.py @@ -15,7 +15,7 @@ def test_strategy_updater_start(user_dir, capsys) -> None: tmpdirp = Path(user_dir) / "strategies" tmpdirp.mkdir(parents=True, exist_ok=True) shutil.copy(teststrats / "strategy_test_v2.py", tmpdirp) - old_code = (teststrats / "strategy_test_v2.py").read_text() + old_code = (teststrats / "strategy_test_v2.py").read_text(encoding="utf-8") args = ["strategy-updater", "--userdir", str(user_dir), "--strategy-list", "StrategyTestV2"] pargs = get_args(args) @@ -29,7 +29,7 @@ def test_strategy_updater_start(user_dir, capsys) -> None: # updated file exists new_file = tmpdirp / "strategy_test_v2.py" assert new_file.exists() - new_code = new_file.read_text() + new_code = new_file.read_text(encoding="utf-8") assert "INTERFACE_VERSION = 3" in new_code assert "INTERFACE_VERSION = 2" in old_code captured = capsys.readouterr()