Permalink
Browse files

Use StringIO.StringIO instead of cStringIO, in order to account for d…

…ifferences in unicode / bytes.
  • Loading branch information...
L. Daniel Burr
L. Daniel Burr committed Jun 18, 2012
1 parent cc03b39 commit f2c193bf4e5bb1c47d50d3f89f36c56592739148
Showing with 3 additions and 3 deletions.
  1. +3 −3 txtemplate/templates.py
View
@@ -2,7 +2,7 @@
Templates support for Twisted projects
"""
-import cStringIO
+import StringIO
import os
import string
@@ -134,7 +134,7 @@ class GenshiTemplateAdapter(object):
interface.implements(itemplate.ITemplate)
def __init__(self, template):
- self._buffer = cStringIO.StringIO()
+ self._buffer = StringIO.StringIO()
self._stream = None
self.template = template
self.delayedCall = None
@@ -173,7 +173,7 @@ def _rendered(self, ignore):
self._buffer = None
if self.delayedCall and self.delayedCall.active():
self.delayedCall.cancel()
- return result
+ return result.encode('UTF-8')
def render(self, **kwargs):
self._stream = self.template.generate(**kwargs)

0 comments on commit f2c193b

Please sign in to comment.