Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pathlib.Path read_text() #4

Closed
umarhunter opened this issue Jul 10, 2023 · 1 comment
Closed

pathlib.Path read_text() #4

umarhunter opened this issue Jul 10, 2023 · 1 comment

Comments

@umarhunter
Copy link

umarhunter commented Jul 10, 2023

In chapter 16 the book used path.read_text() (in 'eq_world_map.py'), when the read_text function now requires a parameter to be passed (encoding=None). In this case, it should be encoding='utf-8' (on my environment). If you don't pass an encoding type, you get this error message:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 32096: character maps to <undefined>

@ehmatthes
Copy link
Owner

ehmatthes commented Jul 10, 2023

Yes, that argument is needed on systems where utf-8 is not the default encoding. In the third printing of the book, I added that argument in for all occurrences of read_text() in Chapter 16. Thank you for bringing this up.

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

No branches or pull requests

2 participants