Skip to content

Commit ad02d2c

Browse files
authored
Update data.py
1 parent 131b997 commit ad02d2c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

data_tutorials/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def update_to(self, b=1, bsize=1, tsize=None):
4040

4141
def download_file(url: str, filename: str, dest: Path) -> None:
4242
save_file = dest / filename
43+
url = url if url.endswith('/') else url + '/'
4344
print(f"try to download {filename} from {url} and save it in {save_file}")
4445
with TqdmUpTo(unit = 'B', unit_scale = True, unit_divisor = 1024, miniters = 1, desc = filename) as t:
4546
path, _ = urlretrieve(url + filename, save_file, reporthook = t.update_to)

0 commit comments

Comments
 (0)