python - App Engine gives error in number formatting when deployed -


i have deployed app , go on homepage '500 internal server error' page. having looked through logs got following error:

type 'exceptions.syntaxerror'>: non-ascii character '\xc2' in file /base/data/home/apps/spare-wheels/1.348259065130939449/sparewheels.py on line 465, no encoding declared; see http://www.python.org/peps/pep-0263.html details (sparewheels.py, line 465)

the line in question looks this:

self.template_values['price_pounds'] = "£%.2f" % (float(self.event.price_pence)/100) 

this worked fine when running on localhost: there number formatting google apps version of python doesn't support?

check encoding of python file, utf-8? error message suggests may have saved file ascii format international characters in file (aka "£") causing google's python runtime barf 500 error.

also try tossing line on first or second line of python file:

# coding=utf-8 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -