classification
Title: Regression in pathlib.path.read_text
Type: Stage: resolved
Components: Library (Lib), Windows Versions: Python 3.11, Python 3.10
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: kusma, methane, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2021-06-22 10:24 by kusma, last changed 2021-06-22 13:40 by methane. This issue is now closed.

Messages (4)
msg396318 - (view) Author: Erik Faye-Lund (kusma) Date: 2021-06-22 10:24
This commit lead to a regression when using Meson on Windows to build the Mesa project:

https://github.com/python/cpython/commit/4827483f47906fecee6b5d9097df2a69a293a85c

The reason is that pathlib.read_text now uses the locale as the encoding when reading files when there's no encoding explicitly passed in. That means that C++ source files are attempted read as CP1252 on Windows, which throws exceptions when source files contain UTF-8 code-points.
msg396328 - (view) Author: Erik Faye-Lund (kusma) Date: 2021-06-22 13:29
After digging some more, I no longer suspect that this commit is to blame, but instead some logic in Meson that effectively disabled the problematic code under in our use-case before we upgraded our Visual Studio version.

The reason is that I was able to reproduce this using Python 3.9, and as far as I can tell that doesn't contain this change.

So, sorry for the noise. I'll close this, and rather reopen if I find out I'm wrong.
msg396330 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2021-06-22 13:38
Please write a link to the original issue next time.
https://github.com/mesonbuild/meson/issues/8916
msg396331 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2021-06-22 13:40
Another upstream issue: https://github.com/mesonbuild/meson/issues/8263
History
Date User Action Args
2021-06-22 13:40:22methanesetmessages: + msg396331
2021-06-22 13:38:07methanesetmessages: + msg396330
2021-06-22 13:29:19kusmasetstatus: open -> closed

messages: + msg396328
stage: resolved
2021-06-22 12:04:26xtreaksetnosy: + paul.moore, tim.golden, steve.dower, zach.ware, methane
components: + Windows
2021-06-22 10:31:16kusmasettitle: Regression -> Regression in pathlib.path.read_text
2021-06-22 10:24:16kusmacreate