[fix] only percent quote the filename
This commit is contained in:
@@ -66,9 +66,13 @@ def openaddresses_download_all_files(out_dir):
|
|||||||
|
|
||||||
def openaddresses_download_configured_files(out_dir):
|
def openaddresses_download_configured_files(out_dir):
|
||||||
for path in openaddresses_config.sources:
|
for path in openaddresses_config.sources:
|
||||||
|
|
||||||
source = six.b('/').join([safe_encode(p) for p in path])
|
source = six.b('/').join([safe_encode(p) for p in path])
|
||||||
zip_path = source + '.zip'
|
filename = safe_encode(path[-1]) + six.b('.zip')
|
||||||
url = urljoin(OPENADDRESSES_LATEST_DIR, quote_plus(zip_path))
|
zip_path = filename + '.zip'
|
||||||
|
zip_url_path = six.b('/').join([safe_encode(p) for p in path[:-1]] + [quote_plus(filename)])
|
||||||
|
|
||||||
|
url = urljoin(OPENADDRESSES_LATEST_DIR, zip_url_path)
|
||||||
|
|
||||||
print(six.u('doing {}').format(safe_decode(source)))
|
print(six.u('doing {}').format(safe_decode(source)))
|
||||||
success = download_and_unzip_file(url, out_dir)
|
success = download_and_unzip_file(url, out_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user