From 6d064edab106f25af270530819203f600fb8d816 Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Sun, 5 Jul 2026 17:52:14 +1000 Subject: [PATCH] fix(test): specify encoding=utf-8 when reading BaseRobot.py/pyproject.toml Windows' open() defaults to the locale codepage (cp1252), not UTF-8. BaseRobot.py's docstrings contain a stylized Unicode math italic pi (U+1D70B), so every open(path) without an explicit encoding here failed with UnicodeDecodeError on every Windows CI job -- this was breaking main itself, not just feature branches built on top of it. Co-Authored-By: Claude Sonnet 5 --- tests/test_backend_capabilities.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_backend_capabilities.py b/tests/test_backend_capabilities.py index 44e8b6291..d381e692e 100644 --- a/tests/test_backend_capabilities.py +++ b/tests/test_backend_capabilities.py @@ -178,7 +178,7 @@ def test_baserobot_module_has_no_pyplot_import(self): "robot", "BaseRobot.py", ) - with open(os.path.normpath(base_robot_path)) as f: + with open(os.path.normpath(base_robot_path), encoding="utf-8") as f: source = f.read() tree = ast.parse(source) @@ -231,7 +231,7 @@ def test_baserobot_module_no_matplotlib_top_level(self): "BaseRobot.py", ) ) - with open(base_robot_path) as f: + with open(base_robot_path, encoding="utf-8") as f: source = f.read() tree = ast.parse(source) @@ -257,7 +257,7 @@ def test_websockets_pin_relaxed(self): toml_path = os.path.normpath( os.path.join(os.path.dirname(__file__), "..", "pyproject.toml") ) - with open(toml_path) as f: + with open(toml_path, encoding="utf-8") as f: content = f.read() self.assertNotIn( "websockets<11",