Properly use a BytesIO in XHTML outputter.
[wrw.git] / wrw / sp / xhtml.py
index 7058138..02e8dd6 100644 (file)
@@ -43,7 +43,7 @@ class htmlindenter(util.indenter, htmlformatter):
 def forreq(req, tree):
     # XXX: Use proper Content-Type for clients accepting it.
     req.ohead["Content-Type"] = "text/html; charset=utf-8"
-    buf = io.StringIO()
+    buf = io.BytesIO()
     htmlindenter.output(buf, tree, doctype=(doctype, dtd), charset="utf-8")
     return [buf.getvalue()]