Skip to content

Commit

Permalink
Windows check_file() fix (#7938)
Browse files Browse the repository at this point in the history
Resolves Ultralytics HUB CI errors.
  • Loading branch information
glenn-jocher committed May 23, 2022
1 parent 9b4e054 commit 541a5b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def check_file(file, suffix=''):
if Path(file).is_file() or not file: # exists
return file
elif file.startswith(('http:/', 'https:/')): # download
url = str(Path(file)).replace(':/', '://') # Pathlib turns :// -> :/
url = file # warning: Pathlib turns :// -> :/
file = Path(urllib.parse.unquote(file).split('?')[0]).name # '%2F' to '/', split https://url.com/file.txt?auth
if Path(file).is_file():
LOGGER.info(f'Found {url} locally at {file}') # file already exists
Expand Down

0 comments on commit 541a5b7

Please sign in to comment.