floodsung / Deep-Learning-Papers-Reading-Roadmap

Deep Learning papers reading roadmap for anyone who are eager to learn this amazing tech!
38.36k stars 7.32k forks source link

UnicodeEncodeError: 'charmap' codec can't encode #85

Open Vyomax opened 6 years ago

Vyomax commented 6 years ago

[3] "Reducing the dimensionality of data with neur [...] (http://www.cs.toronto.edu/~hinton/science.pdf) Traceback (most recent call last): File "download.py", line 102, in print_title(point.text) File "download.py", line 50, in print_title print('\n'.join(("", title, pattern * len(title)))) 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 character u'\uff08' in position 23: character maps to

FoxerLee commented 6 years ago

Add encoding='utf8' anywhere in the download.py when it tries to open some file.

kunalvats commented 6 years ago

At line 87 use this instead:

with open('README.md',encoding='utf8') as readme:
        readme_html = mistune.markdown(readme.read(),encoding='utf8')
        readme_soup = BeautifulSoup.BeautifulSoup(readme_html, "html.parser")
zylcs commented 5 years ago

在第87行使用此代替:

with open('README.md',encoding='utf8') as readme:
        readme_html = mistune.markdown(readme.read(),encoding='utf8')
        readme_soup = BeautifulSoup.BeautifulSoup(readme_html, "html.parser")

但仍会出现以下问题 UnicodeDecodeError: 'gbk' codec can't decode byte 0x89 in position 1829: illegal multibyte sequence

Trenza1ore commented 5 years ago

Maybe it should be 'utf-8' instead of 'utf8' since this is what I tried this morning on my own, and it worked @zylcs