pypa / setuptools

Official project repository for the Setuptools build system
https://pypi.org/project/setuptools/
MIT License
2.34k stars 1.14k forks source link

Adopt more UTF-8 #4309

Closed abravalheri closed 3 weeks ago

abravalheri commented 4 weeks ago

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:

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

[PR docs]: https://setuptools.pypa.io/en/latest/development/developer-guide.html#making-a-pull-request

abravalheri commented 3 weeks ago

@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)