1. use `locale.getpreferredencoding()` to get encoding name. `bytes.decode()` assumes `encoding='utf-8'` by default. It is incorrect on my Windows setup, and causes `UnicodeDecodeError`. 2. use `errors='replace'`. `bytes.decode()` assumes `errors='strict'` by default. Meson shouldn't crash if subprocess outputs some garbage that can't be decoded. `surrogateescape` doesn't work as expected on Windows. On Linux, default `errors` for `sys.stdout` is `strict`, so `surrogateescape` can't be used there too (at least until `sys.stdout` is reconfigured). Fixes https://github.com/mesonbuild/meson/issues/8480pull/8609/head
parent
d1628b8bed
commit
692f673312
1 changed files with 4 additions and 2 deletions
Loading…
Reference in new issue