Skip to content

Bug in cherrytemplate #94

@ghost

Description

Originally reported by: Anonymous


I just installed cherrytemplate today. CherryTemplate-1.0.0.
It seems that printing an integer doesn't work.
Good luck.

peterbe@trillian:~ $ python
Python 2.3.4 (#2, Aug 13 2004, 00:36:58) 
[GCC 3.3.4 (Debian 1:3.3.4-5ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> bmi=-1
>>> from cherrytemplate import renderTemplate
>>> print renderTemplate('Bla bla <py-if="bmi>0">BMI <py-eval="bmi"></py-if>')
Bla bla 
>>> bmi=1
>>> print renderTemplate('Bla bla <py-if="bmi>0">BMI <py-eval="bmi"></py-if>')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/site-packages/cherrytemplate/cherrytemplate.py", line 
 407, in renderTemplate
    result = ''.join(list(result))
TypeError: sequence item 2: expected string, int found
>>> bmi='1'
>>> print renderTemplate('Bla bla <py-if="bmi>0">BMI <py-eval="bmi"></py-if>')
Bla bla BMI 1

Reported by mail@peterbe.com


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions