Stop relying on undocumented duck typing by `urlunsplit()`

There are proposals in CPython to enforce correct types (str, bytes, bytearray) in urllib.parse: bpo-19094 and bpo-22234.
This commit is contained in:
Jacob Walls 2021-06-13 11:29:32 -04:00
parent ece6a2cdd9
commit 185120d725
2 changed files with 1 additions and 1 deletions

0
news/10057.trivial.rst Normal file
View File

View File

@ -150,7 +150,7 @@ class Link(KeyBasedCompareMixin):
def url_without_fragment(self):
# type: () -> str
scheme, netloc, path, query, fragment = self._parsed_url
return urllib.parse.urlunsplit((scheme, netloc, path, query, None))
return urllib.parse.urlunsplit((scheme, netloc, path, query, ''))
_egg_fragment_re = re.compile(r'[#&]egg=([^&]*)')