YaoZeyuan / ZhihuHelp_archived

(停止维护)快速将知乎内容转换为epub电子书, 请移步https://github.com/YaoZeyuan/zhihuhelp_with_node
426 stars 134 forks source link

UnicodeEncodeError: 'charmap' #50

Closed keelii closed 8 years ago

keelii commented 8 years ago

报错了,新安装的 python 2.7.8 操作系统是 Windows 7 64 Bit

C:\Users\Administrator\Desktop\1.7.3.7>python --version
Python 2.7.8

C:\Users\Administrator\Desktop\1.7.3.7>python zhihuHelp.py
Traceback (most recent call last):
  File "zhihuHelp.py", line 11, in <module>
    helper.start()
  File "C:\Users\Administrator\Desktop\1.7.3.7\src\main.py", line 47, in start
    self.check_update()
  File "C:\Users\Administrator\Desktop\1.7.3.7\src\main.py", line 99, in check_u
pdate
    print   u"检查更新。。。"
  File "C:\Python27\lib\encodings\cp437.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-6: cha
racter maps to <undefined>
YaoZeyuan commented 8 years ago

这一行的内容是

    print   u"检查更新。。。"

你是不是编辑过main.py这个文件?可能你在编辑的时候把文件存成ASCII编码了,用记事本打开,然后另存为UTF-8编码试试?

keelii commented 8 years ago

@YaoZeyuan Thx, 用家里的机器是正常的, python 2.7.11

keelii commented 8 years ago

原来是cmd里面的编码设置错了. code