ankitsejwal / Lyndor

:rocket: Powerful command line tool to download lynda.com courses for personal offline use. :part_alternation_mark:
MIT License
131 stars 32 forks source link

TypeError: must be str, not bytes #29

Closed TFWol closed 6 years ago

TFWol commented 6 years ago

Related to #27 It looks like if you run Lyndor on a Win10 machine with normal Locale settings, it will trip on the lines with .encode('utf-8') at the end with the error TypeError: must be str, not bytes.

I'm seeing the error at https://github.com/ankitsejwal/Lyndor/blob/770483b07dc28c106a382596410bca1ead79cf4b/save.py#L177

I think it may also happen at similar lines if it were to reach those. Maybe we need the original code as a try then have it use the .encode upon a Unicode error since the current change doesn't work for all use cases like hoped.

That or do a test branch that only uses Unicode to see if that works for all cases.

ankitsejwal commented 6 years ago

@thefinalwolf I've made the changes please have a look when you get time to see if this patches the issue.

TFWol commented 6 years ago

Yeah, that fixed this issue, thanks.