Skip to content

Commit

Permalink
fix: Resolve Windows path escaping issue in test_editor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Feb 24, 2025
1 parent 3c775fd commit 96fcc5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/basic/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96fcc5d

Please sign in to comment.