Skip to content

Commit 98c8773

Browse files
committed
Explicitly use 'locale' encoding for .pth files in setuptools.namespaces
1 parent fc93ece commit 98c8773

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setuptools/namespaces.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from distutils import log
33
import itertools
44

5+
from .compat import py39
6+
57

68
flatten = itertools.chain.from_iterable
79

@@ -23,7 +25,8 @@ def install_namespaces(self):
2325
list(lines)
2426
return
2527

26-
with open(filename, 'wt') as f:
28+
with open(filename, 'wt', encoding=py39.LOCALE_ENCODING) as f:
29+
# Requires encoding="locale" instead of "utf-8" (python/cpython#77102).
2730
f.writelines(lines)
2831

2932
def uninstall_namespaces(self):

0 commit comments

Comments
 (0)