Skip to content

Commit

Permalink
Fix PermissionError on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
moi90 committed Jan 15, 2024
1 parent 666c1a4 commit cfb284d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion experitur/core/trial_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ def __getitem__(self, trial_id):
try:
with open(path) as f:
trial_data = yaml.load(f, Loader=yaml.Loader)
except (FileNotFoundError, IsADirectoryError) as exc:
except (FileNotFoundError, IsADirectoryError, PermissionError) as exc:
# Apparently, Windows raises a PermissionError instead of a IsADirectoryError
raise KeyError(trial_id) from exc
except:
print(f"Error reading {path}")
Expand Down

0 comments on commit cfb284d

Please # to comment.