File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 14
14
import io
15
15
import os
16
16
import shutil
17
- import sys
18
17
import traceback
19
18
from contextlib import suppress
20
19
from enum import Enum
44
43
namespaces ,
45
44
)
46
45
from .._path import StrPath
46
+ from ..compat import py39
47
47
from ..discovery import find_package_path
48
48
from ..dist import Distribution
49
49
from ..warnings import (
@@ -558,9 +558,8 @@ def _encode_pth(content: str) -> bytes:
558
558
(There seems to be some variety in the way different version of Python handle
559
559
``encoding=None``, not all of them use ``locale.getpreferredencoding(False)``).
560
560
"""
561
- encoding = "locale" if sys .version_info >= (3 , 10 ) else None
562
561
with io .BytesIO () as buffer :
563
- wrapper = io .TextIOWrapper (buffer , encoding )
562
+ wrapper = io .TextIOWrapper (buffer , encoding = py39 . LOCALE_ENCODING )
564
563
wrapper .write (content )
565
564
wrapper .flush ()
566
565
buffer .seek (0 )
You can’t perform that action at this time.
0 commit comments