Skip to content

Commit db2b4c3

Browse files
committed
fix: ensure log folder is created before writing the execution logs
Fixes: 3632
1 parent b036f7d commit db2b4c3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tox/tox_env/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ def _log_execute(self, request: ExecuteRequest, status: ExecuteStatus) -> None:
487487

488488
@staticmethod
489489
def _write_execute_log(env_name: str, log_file: Path, request: ExecuteRequest, status: ExecuteStatus) -> None:
490+
if not log_file.parent.exists():
491+
log_file.parent.mkdir(parents=True, exist_ok=True)
490492
with log_file.open("wt", encoding="utf-8") as file:
491493
file.write(f"name: {env_name}\n")
492494
file.write(f"run_id: {request.run_id}\n")

0 commit comments

Comments
 (0)