2013-03-20 6 views
3

GAE를 1.7.6 (Python 2.7)으로 업그레이드했습니다. 내 앱은 URL에 스페인어 문자 ("españa"또는 "cádiz"와 같은 단어)를 사용합니다. 지금까지 나는 그들을 다루는데 아무런 문제가 없었다. 나는이 문제를 디버깅하는 간단한 응용 프로그램을 작성했습니다GAE : URL에 유니 코드 문자를 사용하는 방법

ProgrammingError('You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.',) 
Traceback (most recent call last): 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate 
req.respond() 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond 
self.server.gateway(self).respond() 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2115, in respond 
response = self.req.server.wsgi_app(self.env, self.start_response) 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 230, in __call__ 
return app(environ, start_response) 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/server.py", line 1114, in __call__ 
return self._handle_request(environ, start_response) 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/server.py", line 512, in _handle_request 
http_version=http_version) 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub.py", line 160, in WrappedMethod 
return method(self, *args, **kwargs) 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/logservice/logservice_stub.py", line 151, in start_request 
host, start_time, method, resource, http_version)) 
ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. 

어떤 긍정적 인 결과로, : 그러나, 업그레이드 후, 내가 가진 내가 내 URL에 특수 문자를 소개 wenever 오류 메시지가 내 응용 프로그램이 충돌 keed

#!/usr/bin/env python 
# -*- coding: utf-8 -*- 

import webapp2 

class MainHandler(webapp2.RequestHandler): 
    def get(self): 
     self.response.write('Hello world!') 

class MyHandler(webapp2.RequestHandler): 
    def get(self, param): 
    self.response.write(param) 

app = webapp2.WSGIApplication([ 
    ('/', MainHandler), 
    ('/(.*)', MyHandler) 
], debug=True) 

"/ hola"URL을 방문하면 예상대로 응답하고 브라우저에 "hola"단어가 표시됩니다. 그러나 "/ españa"또는 "/ espa % C3 % B1a"를 방문하면 개발 서버가 위에 표시된 오류와 충돌합니다.

오류는 개발에서만 발생하며 새 sqlite 데이터베이스와 관련되어 있음을 유의하십시오. 그러나 이전 예제에서 나는 데이터베이스를 전혀 사용하지 않고있다.

아이디어가 있으십니까? 도와주세요!

답변

2

dev 서버의 버그 인 것 같습니다. 지금 당장 가장 좋은 점은 GAE 버그 추적기에 버그에 별표를다는 것입니다 : GAE bug - url's with unicode characters.

사람들이 "별표를 표시"하면 더 빨리이 문제를 해결할 수 있기를 바랍니다.

관련 문제