Python “'ascii' codec can't decode byte 0xb0i in position 1” 的解决方法

在使用python2.7时,使用GAE 的dev_appserver.py开启服务器并启动python程序时,会报
  File "C:\Python27\lib\mimetypes.py", line 249, in enum_types
    ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 1: ordinal
not in range(128)
错误,比较暴力的解决方法是,删除python27\lib 目录下面mimetype.py中的如下代码,在246行,
[python] view plaincopyprint?在CODE上查看代码片派生到我的代码片
try: 
        ctype = ctype.encode(default_encoding) # omit in 3.x! 
except UnicodeEncodeError: 
        pass  Python “'ascii' codec can't decode byte 0xb0i in position 1” 的解决方法

你可能感兴趣的:(position)