Skip to content

Commit

Permalink
bugfix: ensure that log directories don't end in forward/back slash (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire authored Oct 16, 2024
1 parent 23cba31 commit c9f8d23
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Open log files in binary mode when reading headers (fixes ijson deprecation warning).
- Bugfix: strip protocol prefix when resolving eval event content
- Bugfix: switch to run directory when running multiple tasks with the same run directory.
- Bugfix: ensure that log directories don't end in forward/back slash.

## v0.3.41 (11 October 2024)

Expand Down
3 changes: 2 additions & 1 deletion src/inspect_ai/_cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,5 @@ def resolve_common_options(options: CommonOptions) -> Tuple[str, str, str]:
print("Debugger attached")

# return resolved options
return (options["log_dir"], options["log_level"], options["log_level_transcript"])
log_dir = options["log_dir"].rstrip("/\\")
return (log_dir, options["log_level"], options["log_level_transcript"])
2 changes: 1 addition & 1 deletion src/inspect_ai/log/_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def __init__(
self, log_dir: str, suffix: str, fs_options: dict[str, Any] = {}
) -> None:
super().__init__()
self.log_dir = log_dir
self.log_dir = log_dir.rstrip("/\\")
self.fs = filesystem(log_dir, fs_options)
self.fs.mkdir(self.log_dir, exist_ok=True)
self.suffix = suffix
Expand Down

0 comments on commit c9f8d23

Please sign in to comment.