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

BUG: fix confusing error message when yt fails to locate data #4429

Merged
merged 1 commit into from
May 2, 2023

Conversation

neutrinoceros
Copy link
Member

PR Summary

Reprod: leaving test_data_dir unset, and running

import yt

ds = yt.load("not_a_file")

output

FileNotFoundError: No such file or directory: 'not_a_file'.
(Also tried '/Users/robcleme/dev/yt-project/yt/not_a_file').

where /Users/robcleme/dev/yt-project/yt/ is the current work directory, so it looks like yt is considering the absolute version of cwd as an alternative, which is both confusing and unintended.

with this patch, the error is reduced to

FileNotFoundError: No such file or directory: 'not_a_file'.

@neutrinoceros neutrinoceros added bug UX user-experience labels May 1, 2023
@neutrinoceros neutrinoceros changed the title BUG: fix confusing error message when yt fails to locate data but shows current working dir as an attempted alternative path BUG: fix confusing error message when yt fails to locate data May 1, 2023
@jzuhone jzuhone merged commit 6fb7749 into yt-project:main May 2, 2023
@neutrinoceros neutrinoceros deleted the hotfix_alt_path branch May 2, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug UX user-experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants