From 96fcc5df6b9cf39604609431901a439d49d8ee6d Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 24 Feb 2025 12:09:33 -0800 Subject: [PATCH] fix: Resolve Windows path escaping issue in test_editor.py --- tests/basic/test_editor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/basic/test_editor.py b/tests/basic/test_editor.py index b187d7d4b..2fa346def 100644 --- a/tests/basic/test_editor.py +++ b/tests/basic/test_editor.py @@ -90,10 +90,12 @@ def test_pipe_editor_with_fake_editor(): with tempfile.NamedTemporaryFile(mode="w", suffix=".log", delete=False) as log_f: log_path = log_f.name + # Convert to raw string path to avoid escape issues on Windows + log_path_escaped = log_path.replace("\\", "\\\\") with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f: f.write(f"""import sys -with open("{log_path}", "w") as f: +with open(r"{log_path_escaped}", "w") as f: f.write(" ".join(sys.argv)) """) script_path = f.name