[issue32921] .pth files cannot contain folders with utf-8 names

Steve Dower report at bugs.python.org
Mon Mar 5 12:53:23 EST 2018


Steve Dower <steve.dower at python.org> added the comment:

Yes, it'll have significant side effects. The default file encoding on Windows is your configured code page (1252, in your case), and there's no good way around that default. The easiest immediate fix is to re-encode that file yourself.

Perhaps what we could do instead is allow the first line of a .pth file to be a coding comment? Then site.py can reopen the file with the specified encoding.

(FWIW, when I added the ._pth file, I explicitly made it UTF-8. But it had no history at that time so it was safe to do so.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32921>
_______________________________________


More information about the Python-bugs-list mailing list