set allow_fragments to False

This commit is contained in:
Tyler Levy Conde 2024-04-08 13:01:54 -06:00 committed by Pedro Algarvio
parent 2868ac1f89
commit e8c3bdb482

View file

@ -481,11 +481,9 @@ class Client:
"""
Get a single file from a URL.
"""
url = urllib.parse.quote(url, safe=":/")
url_data = urllib.parse.urlparse(url)
url_data = urllib.parse.urlparse(url, allow_fragments=False)
url_scheme = url_data.scheme
url_path = os.path.join(url_data.netloc, url_data.path).rstrip(os.sep)
url_path = urllib.parse.unquote(url_path)
# If dest is a directory, rewrite dest with filename
if dest is not None and (os.path.isdir(dest) or dest.endswith(("/", "\\"))):