From 488748e127d3d3fde6e7ec9344f445aabcca2c6b Mon Sep 17 00:00:00 2001 From: Seth Michael Larson Date: Sun, 28 Apr 2019 10:11:00 -0500 Subject: Remove dead code --- src/urllib3/util/url.py | 8 -------- test/test_util.py | 6 ++++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/urllib3/util/url.py b/src/urllib3/util/url.py index b171248c..0bc6ced7 100644 --- a/src/urllib3/util/url.py +++ b/src/urllib3/util/url.py @@ -233,14 +233,6 @@ def parse_url(url): if has_authority and uri_ref.authority is None: raise LocationParseError(url) - # Percent-encode any characters that aren't allowed in that component - # before normalizing and validating. - #uri_ref = uri_ref.copy_with( - # path=_encode_invalid_chars(uri_ref.path, PATH_CHARS), - # query=_encode_invalid_chars(uri_ref.query, QUERY_CHARS), - # fragment=_encode_invalid_chars(uri_ref.fragment, FRAGMENT_CHARS) - #) - # Only normalize schemes we understand to not break http+unix # or other schemes that don't follow RFC 3986. if uri_ref.scheme is None or uri_ref.scheme.lower() in NORMALIZABLE_SCHEMES: diff --git a/test/test_util.py b/test/test_util.py index 3588bace..cc237b0e 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -234,8 +234,10 @@ class TestUtil(object): # Unicode Surrogates (u'http://google.com/\uD800', Url('http', host='google.com', path='%ED%A0%80')), - (u'http://google.com?q=\uDC00', Url('http', host='google.com', path='', query='q=%ED%B0%80')), - (u'http://google.com#\uDC00', Url('http', host='google.com', path='', fragment='%ED%B0%80')), + (u'http://google.com?q=\uDC00', + Url('http', host='google.com', path='', query='q=%ED%B0%80')), + (u'http://google.com#\uDC00', + Url('http', host='google.com', path='', fragment='%ED%B0%80')), ] @pytest.mark.parametrize( -- cgit v1.2.1