fix: Update temporary script logging to use f-string and full sys.argv

This commit is contained in:
Paul Gauthier (aider) 2025-02-24 10:11:58 -08:00
parent a8635bade2
commit 85189c0bde

View file

@ -95,9 +95,10 @@ def test_pipe_editor_with_fake_editor():
import tempfile import tempfile
with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f: with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f:
f.write("""import sys log_path = f.name + ".log"
with open(sys.argv[0] + ".log", "w") as f: f.write(f"""import sys
f.write(" ".join(sys.argv[1:])) with open("{log_path}", "w") as f:
f.write(" ".join(sys.argv))
""") """)
script_path = f.name script_path = f.name