python库mimetypes的bug
时间:2014-02-20 00:47:20
收藏:0
阅读:402
C:\Python27\lib\mimetypes.py中可能会报错
File "C:\Python27\lib\mimetypes.py", line 250, in enum_types ctype = ctype.encode(default_encoding) # omit in 3.x! UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xe0 in position 0: ordinal not in range(128)
解决方案如下:
是一个bug来的,注释掉下面几行即可
try: ctype = ctype.encode(default_encoding) # omit in 3.x! except UnicodeEncodeError: pass
原文:http://www.cnblogs.com/liyuan1626/p/3555969.html
评论(0)