🐛 Ensure download directory

This commit is contained in:
Gina Häußge committed 2020-09-04 10:31:02 +02:00
1 parent 6132f481ce
commit b3bc1e75aa
1 file changed
+3 -1
+3 -1
View File
@@ -214,7 +214,9 @@ def download_file(url, folder, max_length=None):
# TODO check content-length against safety limit
path = os.path.join(folder, filename)
path = os.path.abspath(os.path.join(folder, filename))
assert path.startswith(folder)
with io.open(path, 'wb') as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)