Mercurial > p > roundup > code
changeset 5437:a1971da1c5da
Python 3 preparation: send bytes to socket in cgi/client.py.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Wed, 25 Jul 2018 11:42:02 +0000 |
| parents | e70fe1d1215b |
| children | e2382945d302 |
| files | roundup/cgi/client.py |
| diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/cgi/client.py Wed Jul 25 11:40:44 2018 +0000 +++ b/roundup/cgi/client.py Wed Jul 25 11:42:02 2018 +0000 @@ -438,7 +438,7 @@ def handle_xmlrpc(self): if self.env.get('CONTENT_TYPE') != 'text/xml': - self.write("This is the endpoint of Roundup <a href='" + + self.write(b"This is the endpoint of Roundup <a href='" + "http://www.roundup-tracker.org/docs/xmlrpc.html'>" + "XML-RPC interface</a>.") return @@ -479,7 +479,7 @@ self.instance.actions, self.translator, allow_none=True) - output = handler.dispatch(input) + output = s2b(handler.dispatch(input)) self.setHeader("Content-Type", "text/xml") self.setHeader("Content-Length", str(len(output))) @@ -1811,7 +1811,9 @@ # client doesn't care about content return - if self.charset != self.STORAGE_CHARSET: + if sys.version_info[0] > 2: + content = content.encode(self.charset, 'xmlcharrefreplace') + elif self.charset != self.STORAGE_CHARSET: # recode output content = content.decode(self.STORAGE_CHARSET, 'replace') content = content.encode(self.charset, 'xmlcharrefreplace')
