On Mon, Mar 15, 2021 at 7:53 PM Inada Naoki <[email protected]> wrote:

> Hi, all.
>
> I found .pth file is decoded by the default (i.e. locale-specific)
> encoding.
>
> https://github.com/python/cpython/blob/0269ce87c9347542c54a653dd78b9f60bb9fa822/Lib/site.py#L173
>
> pth files contain:
>
> * import statements
> * paths
>
> For import statement, UTF-8 is the default Python code encoding.
> For paths, fsencoding is the right encoding. It is UTF-8 on Windows
> (excpet PYTHONLEGACYWINDOWSFSENCODING is set), and locale-specific
> encoding in Linux.
>
> What encoding should we use?
>
> * UTF-8
> * sys.getfilesystemencoding()
> * Keep status-quo.
>

What are packaging tools like pip and setuptools writing .pth files out as?
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/GMVXCNGP2J5JFE4ISANASZ5D67UWWVM7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to