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)

解决方案如下:

http://stackoverflow.com/questions/4237898/unicodedecodeerror-ascii-codec-cant-decode-byte-0xe0-in-position-0-ordinal

是一个bug来的,注释掉下面几行即可

try:
    ctype = ctype.encode(default_encoding) # omit in 3.x!
except UnicodeEncodeError:
    pass

 

相关文章:

  • 2021-09-06
  • 2021-09-04
  • 2022-12-23
  • 2022-01-27
  • 2021-11-30
  • 2021-08-15
  • 2022-01-10
  • 2021-08-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案