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
setup.cfg should standardize on UTF-8 for encoding #1702
Comments
Hmm. On further investigation, I discovered that encoding detection is employed, meaning that adding |
In this comment, the user suggests the default encoding should be UTF-8. I agree and in fact I'd like to work toward the only encoding to be UTF-8 (drop support for encoding detection). |
I see that the encoding detection was added in #1180. @benoit-pierre, do you recall why you chose to have the encoding declared rather than demanding and relying on UTF-8? |
Backward compatibility: to no break some existing workflows (using an encoding other than UTF-8 with a corresponding locale). |
My suggestion was to at least reduce the prevalence of this problem, but detecting intentionally non-user locales like "POSIX" or "C", and upgrade to UTF-8 for those. Requiring people to add a If a user has a specific locale set, that can be a problem solved another day. But again, if the setup.cfg cant be decoded with the user locale, the fallback should be to attempt to decode it with the best guess of the authors locale - utf-8 , especially for any package which has been downloaded from pypi which strongly implies the users locale is irrelevant as the file is not written by the user, but by an author on the other side of the world. |
Also related, I believe pytest was reading it was ascii, but now defaults to utf-8. It is causing breakages in pytest 3.3.2, at least, but not in current pytest. |
I am strongly inclined to assume UTF-8 (which also supports ASCII). I'm also inclined to remove support for the |
@jayvdb Would you be willing to put together a PR? |
Hi @jaraco , I have a related issue.
When I run tox to test itself under Python2:
This is because "edit_config" doesn't pass down the original encoding:
The output is something like:
|
Given that |
In jaraco/configparser#34, I learned that although setuptools v40.7.0 presumably added support for non-ASCII, there are still environments where loading non-ASCII is failing.
The text was updated successfully, but these errors were encountered: