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

The default encoding of Python sources is UTF-8 #3696

Merged
merged 1 commit into from Nov 23, 2022

Conversation

DimitriPapadopoulos
Copy link
Contributor

Summary of changes

Python 3 assumes the encoding is UTF-8 by default, and so do or should do tools such as text editors when opening Python files.

No need to explicitly set *- coding: utf-8 -*-.

Pull Request Checklist

  • Changes have tests
  • News fragment added in [changelog.d/].
    (See [documentation][PR docs] for details)

Python 3 assumes the encoding is UTF-8 by default, and so do or should
do tools such as text editors when opening Python files.

No need to explicitly set `*- coding: utf-8 -*-`.
@DimitriPapadopoulos
Copy link
Contributor Author

Besides, most of these files contain only ASCII characters:

$ file docs/conf.py setuptools/command/upload_docs.py setuptools/dist.py setuptools/tests/script-with-bom.py setuptools/tests/test_manifest.py setuptools/tests/test_msvc14.py setuptools/tests/test_wheel.py 
docs/conf.py:                        Python script, ASCII text executable
setuptools/command/upload_docs.py:   Python script, ASCII text executable
setuptools/dist.py:                  Python script, ASCII text executable
setuptools/tests/script-with-bom.py: Unicode text, UTF-8 (with BOM) text
setuptools/tests/test_manifest.py:   Python script, ASCII text executable
setuptools/tests/test_msvc14.py:     Python script, Unicode text, UTF-8 text executable
setuptools/tests/test_wheel.py:      Python script, Unicode text, UTF-8 text executable
$ 

@abravalheri abravalheri merged commit a79f347 into pypa:main Nov 23, 2022
@abravalheri
Copy link
Contributor

Thanks Dimitri!

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

Successfully merging this pull request may close these issues.

None yet

2 participants