Skip to content

Commit

Permalink
code in py2 needs to be not unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer committed Jun 23, 2018
1 parent e216534 commit 1bf5e64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/five/customerize/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def templateCodeFromViewName(self, viewname):
template = self.templateFromViewName(viewname)
#XXX: we can't do template.read() here because of a bug in
# Zope 3's ZPT implementation.
return open(template.filename, 'rb').read().decode('utf-8')
data = open(template.filename, 'rb').read()
if six.PY2:
return data
return data.decode('utf-8')

def permissionFromViewName(self, viewname):
view = getMultiAdapter((self.context, self.request), name=viewname)
Expand Down

0 comments on commit 1bf5e64

Please sign in to comment.