[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-17 Thread STINNER Victor
STINNER Victor added the comment: Since it's a Python script, the default encoding should be UTF-8, as any Python script. I guess that most pth files don't use characters outside ASCII so it's fine. I think that distutils made a few changes to switch UTF-8 last years, so it's possible.

[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-17 Thread Inada Naoki
Inada Naoki added the comment: locale-specific encoding is not good especially for Windows. But we used it for a long time. Changing the encoding for pth files is breaking change. -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed

[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-12 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +23602 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24837 ___ Python tracker ___

[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-12 Thread Inada Naoki
Change by Inada Naoki : -- superseder: -> Use io.open_code for .pth files ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-02-13 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-02-13 Thread Inada Naoki
New submission from Inada Naoki : https://github.com/python/cpython/blob/4230bd52e3f9f289f02e41ab17a95f50ed4db5a6/Lib/site.py#L160 ``` f = io.TextIOWrapper(io.open_code(fullname)) ``` When default text encoding is not UTF-8 and pth file contains non-ASCII character, it will raise