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
Encoding issue #5
Comments
Is your default encoding UTF8? What does |
|
Can you provide a git repo with your test file so I have the exact same content and not whatever I copy from the github issue? |
Also, please pust full tracebacks, not just the last line... |
Switched to Python 3.9 to match your environment
|
For some weird reason it's using cp1252 instead of utf-8, even though utf-8 should be the default in Python 3... |
after reading https://discuss.python.org/t/pep-597-use-utf-8-for-default-text-file-encoding/1819 and asking on IRC apparently text files default to whatever encoding the OS tells python to use... and of course on windows you seem to get random crap instead of consistent utf8 :) PR welcome that forces utf8 there (read_text has an |
I'm not very familiar with GitHub's interface - apologies. I have confirmed the issue is fixed, when implementing your suggestion. |
OS: Windows 10 21H2
Python: Python 3.10.4
Steps:
example.py (file is saved as UTF-8 with/without a BOM)
If
read_text()
andwrite_text()
are replaced withread_bytes()
andwrite_bytes()
equivalents, the quote processing is fixed (not tested on Linux). Although, additional new lines are erroneously added, I haven't had a chance to look into why.Thank you for your time, this library has saved my many hours.
The text was updated successfully, but these errors were encountered: