diff --git a/tests/test_url.py b/tests/test_url.py index f969cff..319d76c 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -1386,7 +1386,8 @@ def test_domains_are_case_insensitive(self): def test_userinfo_is_case_sensitive(self): self.assertEqual( - canonicalize_url("sftp://UsEr:PaSsWoRd@www.EXAMPLE.com/"), "sftp://UsEr:PaSsWoRd@www.example.com/" + canonicalize_url("sftp://UsEr:PaSsWoRd@www.EXAMPLE.com/"), + "sftp://UsEr:PaSsWoRd@www.example.com/", ) def test_canonicalize_idns(self): diff --git a/w3lib/url.py b/w3lib/url.py index bb6486c..c142048 100644 --- a/w3lib/url.py +++ b/w3lib/url.py @@ -660,9 +660,7 @@ def canonicalize_url( netloc = "@".join(netloc_parts) # every part should be safe already - return urlunparse( - (scheme, netloc, path, params, query, fragment) - ) + return urlunparse((scheme, netloc, path, params, query, fragment)) def _unquotepath(path: str) -> bytes: