Skip to content

Commit 1c9e6e3

Browse files
committed
only encode output on Python 2
1 parent 237cd40 commit 1c9e6e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roundup/cgi/engine_jinja2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from __future__ import print_function
3535
import jinja2
3636
import gettext
37+
import sys
3738

3839
from types import MethodType
3940

@@ -87,7 +88,8 @@ def render(self, client, classname, request, **options):
8788
# [ ] limit the information passed to the minimal necessary set
8889
c = context(client, self, classname, request)
8990
c.update({'options': options})
90-
return self._tpl.render(c).encode(client.charset, )
91+
s = self._tpl.render(c)
92+
return s if sys.version_info[0] > 2 else s.encode(client.STORAGE_CHARSET, )
9193

9294
def __getitem__(self, name):
9395
# [ ] figure out what are these for

0 commit comments

Comments
 (0)