2012-04-12 10 views
0

web.py utils.safeunicode関数にバグが見つかりました。バージョンは0.36web.py safeunicode関数のバグ?

>>> import web 
>>> app=web.application(('/hello','hello'),locals()) 
>>> class hello: 
... def GET(self): 
...  return 'hello world' 

#it's the normal request 
>>> app.request('/hello').data 
'hello world' 

#the Error request 
>>> app.request('hello\xbf').data 
... 
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbf in position 6: unexpected code byte 

である私は「http://web.site/index%bf」のようないくつかのweb.pyウェブサイト上で試みたが、それらのすべては、ステータス500または例外を応答します。それはバグか可笑しさですか?

私はそれは大丈夫だろう342

elif t is str: 
    ooxxxxoo=obj.decode(encoding,'ignore') 
    return ooxxxxoo 

utils.pyラインを修正しました。本当に安全ですか?

答えて

1

私はこの問題をgithubリポジトリとseems to be already fixedで開いています。おそらく0.37に更新する必要がありますか?