You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.
Hi! First I got the problem with Cheetah 2.4.2 in Debian 6.0, but it seems latest Cheetah 2.4.4 has the same bug (if it's a bug and not an error on my side). I narrowed the problem to the following code in Compiler.py, line 1476:
def attributes(self):
attribs = [self.setting('indentationStep') + str(attrib)
for attrib in self._generatedAttribs ]
return '\n\n'.join(attribs)
The problem is in str(attrib) - if attrib is non-ascii unicode (I don't know how Cheetah works but it seems it converts the entire source to unicode) then str(attrib) fails. I cannot even compile the following simple template:
#encoding utf-8
#attr $test = 'тест' # this is 'test' in Russian
See:
$ cheetah compile test.tmpl
Compiling test.tmpl -> test.py
Traceback (most recent call last):
...
File "/usr/lib/pymodules/python2.6/Cheetah/Compiler.py", line 1478, in attributes for attrib in self._generatedAttribs ]
UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-11: ordinal not in range(128)
The text was updated successfully, but these errors were encountered:
Hi! First I got the problem with Cheetah 2.4.2 in Debian 6.0, but it seems latest Cheetah 2.4.4 has the same bug (if it's a bug and not an error on my side). I narrowed the problem to the following code in Compiler.py, line 1476:
The problem is in
str(attrib)
- ifattrib
is non-ascii unicode (I don't know how Cheetah works but it seems it converts the entire source to unicode) thenstr(attrib)
fails. I cannot even compile the following simple template:See:
The text was updated successfully, but these errors were encountered: