error while downloading
Closed this issue · 4 comments
Error while downloading and stop
Traceback (most recent call last):
File "C:\Users\ABC\AppData\Local\Programs\Python\Python36\scripts\lynda-dl-master\lynda-dl.py", line 433, in
main()
File "C:\Users\ABC\AppData\Local\Programs\Python\Python36\scripts\lynda-dl-master\lynda-dl.py", line 405, in main
lynda.InfoExtractor()
File "C:\Users\ABC\AppData\Local\Programs\Python\Python36\scripts\lynda-dl-master\lynda-dl.py", line 169, in InfoExtractor
f.write(str(_data))
File "C:\Users\ABC\AppData\Local\Programs\Python\Python36\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2193' in position 19464: character maps to
Hi.
I got similar issue, it's wasn't happened with all course though. And was able to fix it by running cmd (via ConEmu) with Locale Emulator app in English (US) locale. I'm on Windows 10, my default locale isn't English.
Update:
this workaround could not always work, probably depends on Unicode character that script can't decode due to this bug.
It happens due to improper encoding.
Replace LINES 152 , 68 i.e. with open(lecture_name, "w") as f:
with with open(lecture_name, "w", encoding='utf8') as f:
@rackyman the above syntax will only work for python 3 and not for python 2. i will add a quick fix ASAP.