We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 131b997 commit ad02d2cCopy full SHA for ad02d2c
1 file changed
data_tutorials/data.py
@@ -40,6 +40,7 @@ def update_to(self, b=1, bsize=1, tsize=None):
40
41
def download_file(url: str, filename: str, dest: Path) -> None:
42
save_file = dest / filename
43
+ url = url if url.endswith('/') else url + '/'
44
print(f"try to download {filename} from {url} and save it in {save_file}")
45
with TqdmUpTo(unit = 'B', unit_scale = True, unit_divisor = 1024, miniters = 1, desc = filename) as t:
46
path, _ = urlretrieve(url + filename, save_file, reporthook = t.update_to)
0 commit comments