Skip to content

Commit 03166bc

Browse files
committed
Add compat.py39.LOCALE_ENCODING
1 parent bac21fd commit 03166bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setuptools/compat/py39.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import sys
2+
3+
# Explicitly use the ``"locale"`` encoding in versions that support it,
4+
# otherwise just rely on the implicit handling of ``encoding=None``.
5+
# Since all platforms that support ``EncodingWarning`` also support
6+
# ``encoding="locale"``, this can be used to suppress the warning.
7+
# However, please try to use UTF-8 when possible
8+
# (.pth files are the notorious exception: python/cpython#77102, pypa/setuptools#3937).
9+
LOCALE_ENCODING = "locale" if sys.version_info >= (3, 10) else None

0 commit comments

Comments
 (0)