From 85189c0bde2b8266db4cee74765ac7ff7967b632 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 24 Feb 2025 10:11:58 -0800 Subject: [PATCH] fix: Update temporary script logging to use f-string and full sys.argv --- tests/basic/test_editor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/basic/test_editor.py b/tests/basic/test_editor.py index 2c45eba6e..578ff927c 100644 --- a/tests/basic/test_editor.py +++ b/tests/basic/test_editor.py @@ -95,9 +95,10 @@ def test_pipe_editor_with_fake_editor(): import tempfile with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f: - f.write("""import sys -with open(sys.argv[0] + ".log", "w") as f: - f.write(" ".join(sys.argv[1:])) + log_path = f.name + ".log" + f.write(f"""import sys +with open("{log_path}", "w") as f: + f.write(" ".join(sys.argv)) """) script_path = f.name