Skip to content

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

Merged
abravalheri merged 1 commit into
pypa:mainfrom
DimitriPapadopoulos:utf-8
Nov 23, 2022
Merged

The default encoding of Python sources is UTF-8#3696
abravalheri merged 1 commit into
pypa:mainfrom
DimitriPapadopoulos:utf-8

Conversation

@DimitriPapadopoulos

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Thanks Dimitri!

@DimitriPapadopoulos DimitriPapadopoulos deleted the utf-8 branch November 23, 2022 19:22
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.

2 participants