Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

TypeError: must be str, not bytes #29

Closed
TFWol opened this issue Apr 30, 2018 · 2 comments
Closed

TypeError: must be str, not bytes #29

TFWol opened this issue Apr 30, 2018 · 2 comments

Comments

@TFWol
Copy link
Contributor

TFWol commented Apr 30, 2018

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

Lyndor/save.py

Line 177 in 770483b

content_md.writelines('\n\n## ' + (chapters[chapter_count].text).encode('utf-8') + '\n')

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 added a commit that referenced this issue Apr 30, 2018
@ankitsejwal
Copy link
Owner

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

@TFWol
Copy link
Contributor Author

TFWol commented Apr 30, 2018

Yeah, that fixed this issue, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants