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
bb-migration opened this Issue Jan 22, 2005 · 1 comment

Comments

Projects
None yet
1 participant
@bb-migration

bb-migration 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


@bb-migration

This comment has been minimized.

Show comment
Hide comment
@bb-migration

bb-migration 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

bb-migration 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

jaraco pushed a commit that referenced this issue Apr 30, 2016

Merged in EoghanMurray/cherrypy/host-localhost (pull request #94)
The base can be found at request.headers['Host'] if serving standalone. Useful for development at local.example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment