mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 17:28:53 +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)
|
||||
shareid_s = ""
|
||||
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),
|
||||
tags.td(tags.div(s.get_nickname(), class_="nickname"),
|
||||
tags.div(tags.tt(s.get_name()), class_="nodeid")))
|
||||
@ -207,12 +210,12 @@ class ResultsBase(object):
|
||||
return [html.escape(w) for w in s]
|
||||
|
||||
def _render_si_link(self, req, storage_index):
|
||||
si_s = base32.b2a(storage_index)
|
||||
ophandle = req.prepath[-1]
|
||||
si_s = str(base32.b2a(storage_index), "utf-8")
|
||||
ophandle = str(req.prepath[-1], "utf-8")
|
||||
target = "%s/operations/%s/%s" % (get_root(req), ophandle, si_s)
|
||||
output = get_arg(req, "output")
|
||||
if output:
|
||||
target = target + "?output=%s" % output
|
||||
target = target + "?output=" + str(output, "utf-8")
|
||||
return tags.a(si_s, href=target)
|
||||
|
||||
|
||||
|
@ -148,7 +148,7 @@ def get_format(req, default="CHK"):
|
||||
elif arg.upper() == b"MDMF":
|
||||
return "MDMF"
|
||||
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)
|
||||
|
||||
def get_mutable_type(file_format): # accepts result of get_format()
|
||||
|
@ -1194,7 +1194,7 @@ class ManifestElement(ReloadableMonitorElement):
|
||||
si = self.monitor.origin_si
|
||||
if not si:
|
||||
return "<LIT>"
|
||||
return base32.b2a(si)[:6]
|
||||
return unicode(base32.b2a(si)[:6], "utf-8")
|
||||
|
||||
@renderer
|
||||
def title(self, req, tag):
|
||||
|
Loading…
Reference in New Issue
Block a user