mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-04 12:14:11 +00:00
More passing tests on Python 3.
This commit is contained in:
parent
73537351a7
commit
a27dc83920
@ -674,7 +674,7 @@ def url_for_string(req, url_string):
|
|||||||
and the given URL string.
|
and the given URL string.
|
||||||
"""
|
"""
|
||||||
url = DecodedURL.from_text(url_string.decode("utf-8"))
|
url = DecodedURL.from_text(url_string.decode("utf-8"))
|
||||||
if url.host == b"":
|
if not url.host:
|
||||||
root = req.URLPath()
|
root = req.URLPath()
|
||||||
netloc = root.netloc.split(b":", 1)
|
netloc = root.netloc.split(b":", 1)
|
||||||
if len(netloc) == 1:
|
if len(netloc) == 1:
|
||||||
|
@ -66,8 +66,8 @@ def POSTUnlinkedCHK(req, client):
|
|||||||
# if when_done= is provided, return a redirect instead of our
|
# if when_done= is provided, return a redirect instead of our
|
||||||
# usual upload-results page
|
# usual upload-results page
|
||||||
def _done(upload_results, redir_to):
|
def _done(upload_results, redir_to):
|
||||||
if "%(uri)s" in redir_to:
|
if b"%(uri)s" in redir_to:
|
||||||
redir_to = redir_to.replace("%(uri)s", urlquote(upload_results.get_uri()))
|
redir_to = redir_to.replace(b"%(uri)s", urlquote(upload_results.get_uri()).encode("utf-8"))
|
||||||
return url_for_string(req, redir_to)
|
return url_for_string(req, redir_to)
|
||||||
d.addCallback(_done, when_done)
|
d.addCallback(_done, when_done)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user