classification
Title: site: Potential UnicodeDecodeError when handling pth file
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: methane
Priority: normal Keywords: 3.8regression, easy

Created on 2021-02-13 08:53 by methane, last changed 2021-02-13 08:55 by methane.

Messages (1)
msg386916 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2021-02-13 08:53
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 UnicodeDecodeError.
History
Date User Action Args
2021-02-13 08:55:43methanesetkeywords: + easy
2021-02-13 08:53:26methanecreate