From 5a235f953cd19518ced2ea13b897f792d2f679be Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 12 Oct 2023 12:08:10 -0400 Subject: [PATCH] RF: Use as_posix() and f-strings to construct URL --- templateflow/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templateflow/api.py b/templateflow/api.py index 1a30cd54..ecef3af7 100644 --- a/templateflow/api.py +++ b/templateflow/api.py @@ -291,8 +291,8 @@ def _s3_get(filepath): from tqdm import tqdm import requests - path = str(filepath.relative_to(TF_LAYOUT.root)) - url = "%s/%s" % (TF_S3_ROOT, path.replace("\\", "/")) + path = filepath.relative_to(TF_LAYOUT.root).as_posix() + url = f"{TF_S3_ROOT}/{path}" print("Downloading %s" % url, file=stderr) # Streaming, so we can iterate over the response.