mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-23 23:02:25 +00:00
Method that doesn't break on Python 3.
This commit is contained in:
parent
23a71db38d
commit
e8308043e3
@ -97,9 +97,10 @@ def format_http_success(resp):
|
||||
return "%s %s" % (resp.status, quote_output(resp.reason, quotemarks=False))
|
||||
|
||||
def format_http_error(msg, resp):
|
||||
# ensure_text() shouldn't be necessary when Python 2 is dropped.
|
||||
return quote_output(
|
||||
"%s: %s %s\n%s" % (msg, resp.status, str(resp.reason, "utf-8"),
|
||||
str(resp.read(), "utf-8")),
|
||||
"%s: %s %s\n%s" % (msg, resp.status, six.ensure_text(resp.reason),
|
||||
six.ensure_text(resp.read())),
|
||||
quotemarks=False)
|
||||
|
||||
def check_http_error(resp, stderr):
|
||||
|
Loading…
Reference in New Issue
Block a user