Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try loading models from the cwd ever #223

Merged
merged 4 commits into from
Apr 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Throw a more helpful error in cross-device cases
  • Loading branch information
norabelrose committed Apr 29, 2023
commit 2cec7b09aa3e0d843010a76931d60c64ef8be01e
9 changes: 8 additions & 1 deletion elk/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ def temporary_dir_move(path: Path | str):
with TemporaryDirectory() as tmp:
if path.exists():
dest = Path(tmp) / path.name
path.rename(dest)
try:
path.rename(dest)
except OSError as e:
print(
f"You have a local directory '{dest.absolute()}' whose name "
f"conflicts with {path}. We tried to move it for you, but failed "
f" with error '{e}'. Please rename the directory and try again."
)
else:
dest = None

Expand Down