ozzieperez / packtpub-library-downloader

Script to download all your PacktPub ebooks and videos
218 stars 62 forks source link

print(title.encode(sys.stdout.encoding, errors='replace').decode()) and python 2.7.13 #10

Closed dan-and closed 6 years ago

dan-and commented 7 years ago

Your #6 fix didn't work for python 2.7.13

print(title.encode(sys.stdout.encoding, errors='replace').decode()) does not work with python 2.7.13

results (sometimes) in: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 18: ordinal not in range(128)

Python 3.5 works fine.

arekstasiewicz commented 7 years ago

MediaWiki Administrators’ Tutorial Guide

will trigger the error (utf-8 character?)

ozzieperez commented 6 years ago

This should be fixed now. I merged the commit from @irzan2010

https://github.com/ozzieperez/packtpub-library-downloader/commit/4e514c474c373f3d2b46ebcbb4c45136473fb1c6#diff-236012c1e2500a3dc7ae7ca0a6dcd51e

Thanks for the test case @arekstasiewicz and @dan-and for reporting it