Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in cherrytemplate #94

Closed
ghost opened this issue Jan 22, 2005 · 1 comment
Closed

Bug in cherrytemplate #94

ghost opened this issue Jan 22, 2005 · 1 comment

Comments

@ghost
Copy link

@ghost ghost commented Jan 22, 2005

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


@ghost
Copy link
Author

@ghost ghost commented Jan 22, 2005

Original comment by Anonymous:


This is not a bug ...
You have to use str(i) to render integers...
Also, CherryTemplate now has its own Trac site: http://cherrytemplate.python-hosting.com

@ghost ghost added major bug CherryPy code labels Apr 30, 2016
@ghost ghost closed this Apr 30, 2016
jaraco pushed a commit that referenced this issue Apr 30, 2016
The base can be found at request.headers['Host'] if serving standalone. Useful for development at local.example.com
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
0 participants
You can’t perform that action at this time.