Skip to content

FIX: Coerce license path to pathlike #2180

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

Merged
merged 1 commit into from
Jun 7, 2020
Merged
Changes from all commits
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
1 change: 1 addition & 0 deletions wrapper/fmriprep_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def __call__(self, parser, namespace, values, option_string=None):

def _is_file(path, parser):
"""Ensure a given path exists and it is a file."""
path = os.path.abspath(path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest that we switch to return os.path.abspath(path), so that the exception matches the user input.

Feel free to disregard and merge, if you disagree. This is a good fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge it in as is, I feel the full path to the invalid license would be helpful when debugging

if not os.path.isfile(path):
raise parser.error(
"Path should point to a file (or symlink of file): <%s>." % path
Expand Down