-
Notifications
You must be signed in to change notification settings - Fork 660
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
fix for local file uploads without scheme #1326
base: master
Are you sure you want to change the base?
Conversation
…he absolute path for the file in such cases and use it as source url
if base_url != 'file://': | ||
return remote_url | ||
absoulte_path = os.path.abspath(remote_url) | ||
return base_url + absoulte_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that, in case a user adds a file that is already prefixed with file://
, the os.path.abspath(remote_url)
will return an unexpected value. For example:
>>> os.path.abspath("file:///home/ajecc/work")
'/home/ajecc/file:/home/ajecc/work'
I suggest checking if the remote_url already starts with file://
, in which case you don't need to add the base_url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting it @eugen-ajechiloae-clearml . Sorry i missed this case. Updated the code and tested it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eugen-ajechiloae-clearml , please review this change once when you get the time.
…he absolute path for the file in such cases and use it as source url
… into fix-local-file-uploads
Fix issue on scenario where local file path is provided without scheme in add_external_file functionality.
Related Issue \ discussion
Fix for #1313
Patch Description
If the file added has a local path, the absolute path is fetched and the 'file://' scheme is added.
Testing Instructions
Described in [#1313]
Other Information
Tested file addition using absolute path, relative path and remote path. File addition and upload is working fine.
I could only test for Windows system.