]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] GH-119496: accept UTF-8 BOM in .pth files (GH-119509)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 24 May 2024 14:52:09 +0000 (16:52 +0200)
committerGitHub <noreply@github.com>
Fri, 24 May 2024 14:52:09 +0000 (14:52 +0000)
commit4c0bc69238458e7e71d4ee26d926b706e7909977
tree454ca79022130e2307a09c2398a858c612e74191
parent078da88ad19e8f7474b6943edd39b7e61511bd20
[3.12] GH-119496: accept UTF-8 BOM in .pth files (GH-119509)

`Out-File -Encoding utf8` and similar commands in Windows Powershell 5.1 emit
UTF-8 with a BOM marker, which the regular `utf-8` codec decodes incorrectly.

`utf-8-sig` accepts a BOM, but also works correctly without one.

This change also makes .pth files match the way Python source files are handled.

(cherry picked from commit bf5b6467f8cc06759f3396ab1a8ad64fe7d1db2e)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Lib/site.py