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

Work with files on Windows #1

Closed
bbbburns opened this issue Jul 15, 2023 · 3 comments
Closed

Work with files on Windows #1

bbbburns opened this issue Jul 15, 2023 · 3 comments
Assignees

Comments

@bbbburns
Copy link
Owner

Figure out how to make this work on Windows as well as Linux to address the following comment:

In case anyone else sees the same issue I had, when using Python 3.11 on Windows 10, I had to convert the .csv to ANSI encoding from UTF-8. Until I figured that one out, it kept erroring out with:
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x8d in position 3490: character maps to

@bbbburns
Copy link
Owner Author

Hmm, one possible resolution could be documentation that says:

"Windows Python users, please set your encoding to UTF-8 globally per this thread: https://dev.to/methane/python-use-utf-8-mode-on-windows-212i "

I'm not sure that's the best solution. I could PROBABLY just assume UTF-8 in my code because I know this is a file being generated from GoodReads. Something like:

with open(csv_path, newline="", encoding="UTF-8") as csv_file:

@bbbburns
Copy link
Owner Author

Perhaps commit 1025a1c will resolve this?

@bbbburns
Copy link
Owner Author

bbbburns commented Nov 6, 2023

Assuming 1025a1c resolved this issue.

@bbbburns bbbburns closed this as completed Nov 6, 2023
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

1 participant