mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 21:17:54 +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))
|
return "%s %s" % (resp.status, quote_output(resp.reason, quotemarks=False))
|
||||||
|
|
||||||
def format_http_error(msg, resp):
|
def format_http_error(msg, resp):
|
||||||
|
# ensure_text() shouldn't be necessary when Python 2 is dropped.
|
||||||
return quote_output(
|
return quote_output(
|
||||||
"%s: %s %s\n%s" % (msg, resp.status, str(resp.reason, "utf-8"),
|
"%s: %s %s\n%s" % (msg, resp.status, six.ensure_text(resp.reason),
|
||||||
str(resp.read(), "utf-8")),
|
six.ensure_text(resp.read())),
|
||||||
quotemarks=False)
|
quotemarks=False)
|
||||||
|
|
||||||
def check_http_error(resp, stderr):
|
def check_http_error(resp, stderr):
|
||||||
|
Loading…
Reference in New Issue
Block a user