Je suis en train de mettre en place un prototype de base avec Google App Engine, et je reçois l'erreur suivante avec le Google App Engine Launcher lorsque vous essayez de déployer:Google App Engine: Python UnicodeDecodeError
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 2: ordinal not in range(128)
J'ai trouvé this related SO thread, mais je ne sais pas trop comment spécifier correctement le décodage dans mon exemple. J'utilise le code Python suivant:
import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template
class MainHandler(webapp.RequestHandler):
def get (self, q):
if q is None:
q = 'index.html'
path = os.path.join (os.path.dirname (__file__), q)
self.response.headers ['Content-Type'] = 'text/html'
self.response.out.write (template.render (path, {}))
def main():
application = webapp.WSGIApplication ([('/(.*html)?', MainHandler)], debug=True)
util.run_wsgi_app (application)
if __name__ == '__main__':
main()
Merci pour toute assistance ici.
cela aidera peut-être: http://stackoverflow.com/questions/21393758/unicodedecodeerror-ascii-codec-cant -decode-octet-0xe5-en-position-0-ordinal – dlebech
merci dlebech; Je n'avais pas trouvé ce fil plus tôt. – nickpish