mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
Fix some unicode(bytes_object) bugs.
This commit is contained in:
parent
9190f323d3
commit
05a85b0ce2
@ -323,7 +323,7 @@ class DirectoryNode(object):
|
||||
return "<%s %s-%s %s>" % (self.__class__.__name__,
|
||||
self.is_readonly() and "RO" or "RW",
|
||||
self.is_mutable() and "MUT" or "IMM",
|
||||
hasattr(self, '_uri') and self._uri.abbrev())
|
||||
hasattr(self, '_uri') and str(self._uri.abbrev(), "utf-8"))
|
||||
|
||||
def get_size(self):
|
||||
"""Return the size of our backing mutable file, in bytes, if we've
|
||||
|
@ -56,7 +56,7 @@ def do_http(method, url, **kwargs):
|
||||
# https://github.com/twisted/treq/pull/159 has landed
|
||||
if 400 <= response.code < 600:
|
||||
raise VerboseError(
|
||||
response.code, response="For request {} to {}, got: {}".format(
|
||||
response.code, response="For request {!r} to {!r}, got: {!r}".format(
|
||||
method, url, body))
|
||||
returnValue(body)
|
||||
|
||||
|
@ -197,8 +197,8 @@ def _logFormatter(logDateTime, request):
|
||||
template = "web: %(clientip)s %(method)s %(uri)s %(code)s %(length)s"
|
||||
return template % dict(
|
||||
clientip=_get_client_ip(request),
|
||||
method=request.method,
|
||||
uri=uri,
|
||||
method=str(request.method, "utf-8"),
|
||||
uri=str(uri, "utf-8"),
|
||||
code=request.code,
|
||||
length=(request.sentLength or "-"),
|
||||
facility="tahoe.webish",
|
||||
|
Loading…
Reference in New Issue
Block a user