More passing tests on Python 3.

This commit is contained in:
Itamar Turner-Trauring 2021-02-01 11:42:09 -05:00
parent 73537351a7
commit a27dc83920
2 changed files with 3 additions and 3 deletions

View File

@ -674,7 +674,7 @@ def url_for_string(req, url_string):
and the given URL string.
"""
url = DecodedURL.from_text(url_string.decode("utf-8"))
if url.host == b"":
if not url.host:
root = req.URLPath()
netloc = root.netloc.split(b":", 1)
if len(netloc) == 1:

View File

@ -66,8 +66,8 @@ def POSTUnlinkedCHK(req, client):
# if when_done= is provided, return a redirect instead of our
# usual upload-results page
def _done(upload_results, redir_to):
if "%(uri)s" in redir_to:
redir_to = redir_to.replace("%(uri)s", urlquote(upload_results.get_uri()))
if b"%(uri)s" in redir_to:
redir_to = redir_to.replace(b"%(uri)s", urlquote(upload_results.get_uri()).encode("utf-8"))
return url_for_string(req, redir_to)
d.addCallback(_done, when_done)
else: