python27中 Libmimetypes.py的一个bug,属于 def enum_types(mimedb)函数:
错误提示信息:
1
2
3
|
File D:Python27libmimetypes.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 ) |
解决办法:
修改原函数为:
1
2
3
4
5
|
try : # ctype = ctype.encode(default_encoding) # omit in 3 .x! # except UnicodeEncodeError: # except UnicodeError: # pass |