Previously, changes regarding UTF-8 avoided touching complicated parts of the code where it could cause incompatibility.
This PR is a bit more aggressive, but still try to maintain backwards compatibility:
When reading files, first try to read them as UTF-8, then we fallback to the locale encoding.
When writing files, use UTF-8.
In my opinion the highest risk here are in the easy_install/install_scripts commands, because it might be the case some scripts are not meant to be UTF-8... But hopefully that risk would be minimal[^1].
[^1]: Once file contents are encoded as Python strings they are already encoded as UTF-8, so it should be OK to write them directly to files. Moreover, most popular scripting languages nowadays support UTF-8.
Closes
Pull Request Checklist
[ ] Changes have tests
[ ] News fragment added in newsfragments/.
(See [documentation][PR docs] for details)
@jaraco, please let me know if you are OK with a more aggressive move towards UTF-8.
(in this PR I am still trying to avoid breaking changes by adding some fallback, but one never know the edge cases)
Summary of changes
Previously, changes regarding UTF-8 avoided touching complicated parts of the code where it could cause incompatibility.
This PR is a bit more aggressive, but still try to maintain backwards compatibility:
locale
encoding.In my opinion the highest risk here are in the
easy_install/install_scripts
commands, because it might be the case some scripts are not meant to be UTF-8... But hopefully that risk would be minimal[^1].[^1]: Once file contents are encoded as Python strings they are already encoded as UTF-8, so it should be OK to write them directly to files. Moreover, most popular scripting languages nowadays support UTF-8.
Closes
Pull Request Checklist
newsfragments/
. (See [documentation][PR docs] for details)[PR docs]: https://setuptools.pypa.io/en/latest/development/developer-guide.html#making-a-pull-request