diff --git a/tests/test_updater_ng.py b/tests/test_updater_ng.py index 3616e649ec..30d9e4b8a0 100644 --- a/tests/test_updater_ng.py +++ b/tests/test_updater_ng.py @@ -112,7 +112,7 @@ def setUp(self) -> None: + utils.TEST_HOST_ADDRESS + ":" + str(self.server_process_handler.port) - + repository_basepath + + repository_basepath.replace("\\","/") ) self.metadata_url = f"{url_prefix}/metadata/" diff --git a/tuf/ngclient/fetcher.py b/tuf/ngclient/fetcher.py index 6e8f2df27d..f10c5156e2 100644 --- a/tuf/ngclient/fetcher.py +++ b/tuf/ngclient/fetcher.py @@ -10,7 +10,6 @@ import tempfile from contextlib import contextmanager from typing import IO, Iterator -from urllib import parse from tuf import exceptions @@ -61,13 +60,6 @@ def download_file(self, url: str, max_length: int) -> Iterator[IO]: Yields: A TemporaryFile object that points to the contents of 'url'. """ - # 'url.replace('\\', '/')' is needed for compatibility with - # Windows-based systems, because they might use back-slashes in place - # of forward-slashes. This converts it to the common format. - # unquote() replaces %xx escapes in a url with their single-character - # equivalent. A back-slash may beencoded as %5c in the url, which - # should also be replaced with a forward slash. - url = parse.unquote(url).replace("\\", "/") logger.debug("Downloading: %s", url) number_of_bytes_received = 0