glenn-jocher commited on
Commit
541a5b7
1 Parent(s): 9b4e054

Windows `check_file()` fix (#7938)

Browse files

Resolves Ultralytics HUB CI errors.

Files changed (1) hide show
  1. utils/general.py +1 -1
utils/general.py CHANGED
@@ -419,7 +419,7 @@ def check_file(file, suffix=''):
419
  if Path(file).is_file() or not file: # exists
420
  return file
421
  elif file.startswith(('http:/', 'https:/')): # download
422
- url = str(Path(file)).replace(':/', '://') # Pathlib turns :// -> :/
423
  file = Path(urllib.parse.unquote(file).split('?')[0]).name # '%2F' to '/', split https://url.com/file.txt?auth
424
  if Path(file).is_file():
425
  LOGGER.info(f'Found {url} locally at {file}') # file already exists
 
419
  if Path(file).is_file() or not file: # exists
420
  return file
421
  elif file.startswith(('http:/', 'https:/')): # download
422
+ url = file # warning: Pathlib turns :// -> :/
423
  file = Path(urllib.parse.unquote(file).split('?')[0]).name # '%2F' to '/', split https://url.com/file.txt?auth
424
  if Path(file).is_file():
425
  LOGGER.info(f'Found {url} locally at {file}') # file already exists