mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-01 18:56:41 +00:00
More fixes for unicode-of-bytes bugs.
This commit is contained in:
parent
eebeca31f5
commit
9f1ca2ab6f
@ -156,7 +156,10 @@ class ResultsBase(object):
|
|||||||
shares_on_server.add(s, shareid)
|
shares_on_server.add(s, shareid)
|
||||||
shareid_s = ""
|
shareid_s = ""
|
||||||
if i == 0:
|
if i == 0:
|
||||||
shareid_s = str(shareid)
|
if isinstance(shareid, bytes):
|
||||||
|
shareid_s = str(shareid, "utf-8")
|
||||||
|
else:
|
||||||
|
shareid_s = str(shareid)
|
||||||
d = tags.tr(tags.td(shareid_s),
|
d = tags.tr(tags.td(shareid_s),
|
||||||
tags.td(tags.div(s.get_nickname(), class_="nickname"),
|
tags.td(tags.div(s.get_nickname(), class_="nickname"),
|
||||||
tags.div(tags.tt(s.get_name()), class_="nodeid")))
|
tags.div(tags.tt(s.get_name()), class_="nodeid")))
|
||||||
@ -207,12 +210,12 @@ class ResultsBase(object):
|
|||||||
return [html.escape(w) for w in s]
|
return [html.escape(w) for w in s]
|
||||||
|
|
||||||
def _render_si_link(self, req, storage_index):
|
def _render_si_link(self, req, storage_index):
|
||||||
si_s = base32.b2a(storage_index)
|
si_s = str(base32.b2a(storage_index), "utf-8")
|
||||||
ophandle = req.prepath[-1]
|
ophandle = str(req.prepath[-1], "utf-8")
|
||||||
target = "%s/operations/%s/%s" % (get_root(req), ophandle, si_s)
|
target = "%s/operations/%s/%s" % (get_root(req), ophandle, si_s)
|
||||||
output = get_arg(req, "output")
|
output = get_arg(req, "output")
|
||||||
if output:
|
if output:
|
||||||
target = target + "?output=%s" % output
|
target = target + "?output=" + str(output, "utf-8")
|
||||||
return tags.a(si_s, href=target)
|
return tags.a(si_s, href=target)
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ def get_format(req, default="CHK"):
|
|||||||
elif arg.upper() == b"MDMF":
|
elif arg.upper() == b"MDMF":
|
||||||
return "MDMF"
|
return "MDMF"
|
||||||
else:
|
else:
|
||||||
raise WebError("Unknown format: %s, I know CHK, SDMF, MDMF" % arg,
|
raise WebError("Unknown format: %s, I know CHK, SDMF, MDMF" % str(arg, "ascii"),
|
||||||
http.BAD_REQUEST)
|
http.BAD_REQUEST)
|
||||||
|
|
||||||
def get_mutable_type(file_format): # accepts result of get_format()
|
def get_mutable_type(file_format): # accepts result of get_format()
|
||||||
|
@ -1194,7 +1194,7 @@ class ManifestElement(ReloadableMonitorElement):
|
|||||||
si = self.monitor.origin_si
|
si = self.monitor.origin_si
|
||||||
if not si:
|
if not si:
|
||||||
return "<LIT>"
|
return "<LIT>"
|
||||||
return base32.b2a(si)[:6]
|
return unicode(base32.b2a(si)[:6], "utf-8")
|
||||||
|
|
||||||
@renderer
|
@renderer
|
||||||
def title(self, req, tag):
|
def title(self, req, tag):
|
||||||
|
Loading…
Reference in New Issue
Block a user