From: Fredrik Tolf Date: Wed, 5 Jun 2013 10:58:21 +0000 (+0200) Subject: Merge branch 'master' into python3 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=3b67497cb853ea7dd49f579566e5f0b60a3c97d7;p=wrw.git Merge branch 'master' into python3 --- 3b67497cb853ea7dd49f579566e5f0b60a3c97d7 diff --cc wrw/sp/xhtml.py index 17c5678,d19fc99..52e7f9f --- a/wrw/sp/xhtml.py +++ b/wrw/sp/xhtml.py @@@ -51,9 -51,11 +51,11 @@@ class htmlindenter(util.indenter, htmlf def forreq(req, tree): # XXX: Use proper Content-Type for clients accepting it. req.ohead["Content-Type"] = "text/html; charset=utf-8" - buf = StringIO.StringIO() + buf = io.BytesIO() htmlindenter.output(buf, tree, doctype=(doctype, dtd), charset="utf-8") - return [buf.getvalue()] + ret = buf.getvalue() + req.ohead["Content-Length"] = len(ret) + return [ret] def xhtmlresp(callable): def wrapper(req):