From 541a5b72bbb78b4eac8ef9961daa7b06399b8c2b Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 23 May 2022 16:15:38 +0200 Subject: [PATCH] Windows `check_file()` fix (#7938) Resolves Ultralytics HUB CI errors. --- utils/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/general.py b/utils/general.py index bb1aa667d8a0..ed5cc38da307 100755 --- a/utils/general.py +++ b/utils/general.py @@ -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