diff options
author | Aleksandr Mezin <mezin.alexander@gmail.com> | 2021-03-06 12:03:42 +0600 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-03-30 18:47:09 +0300 |
commit | 692f6733122b2bf053299f8a0cdbcab3d5bfbfb5 (patch) | |
tree | 3d554fd08b040e33d657e3947ec4c8254b7157cb /mesonbuild/interpreter/compiler.py | |
parent | d1628b8bed5d88318e757d7bfe17bceb0e3be230 (diff) | |
download | meson-692f6733122b2bf053299f8a0cdbcab3d5bfbfb5.zip meson-692f6733122b2bf053299f8a0cdbcab3d5bfbfb5.tar.gz meson-692f6733122b2bf053299f8a0cdbcab3d5bfbfb5.tar.bz2 |
scripts/meson_exe: fix stdout and stderr decoding
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/8480
Diffstat (limited to 'mesonbuild/interpreter/compiler.py')
0 files changed, 0 insertions, 0 deletions