meson/mesonbuild/scripts
Aleksandr Mezin 692f673312 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
2021-03-30 18:47:09 +03:00
..
__init__.py typing: fully annotate scripts 2020-09-08 20:15:56 +02:00
clangformat.py clangformat: Add clang-format-check target 2021-03-16 21:01:54 -04:00
clangtidy.py Fix clang-tidy return value reporting (Part Ⅱ) 2020-11-17 17:50:27 +02:00
cleantrees.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
cmake_run_ctgt.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
cmd_or_ps.ps1 Add `meson devenv` command and meson.add_devenv() 2021-03-16 09:00:50 -04:00
coverage.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
delwithsuffix.py typing: fully annotate scripts 2020-09-08 20:15:56 +02:00
depfixer.py depfixer: temporarily modify file permissions 2021-03-24 17:51:57 +02:00
depscan.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
dirchanger.py typing: fully annotate scripts 2020-09-08 20:15:56 +02:00
externalproject.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
gettext.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
gtkdochelper.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
hotdochelper.py typing: fully annotate scripts 2020-09-08 20:15:56 +02:00
meson_exe.py scripts/meson_exe: fix stdout and stderr decoding 2021-03-30 18:47:09 +03:00
msgfmthelper.py typing: fully annotate scripts 2020-09-08 20:15:56 +02:00
regen_checker.py Use a single coredata dictionary for options 2021-01-04 12:20:58 -08:00
scanbuild.py Fix #5492 (#7919) 2020-11-01 10:50:15 -08:00
symbolextractor.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
tags.py typing: get rid of most T.cast 2020-09-08 20:15:58 +02:00
uninstall.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00
vcstagger.py typing: fully annotate scripts 2020-09-08 20:15:56 +02:00
yelphelper.py mass rewrite of string formatting to use f-strings everywhere 2021-03-04 17:16:11 -05:00