diff options
author | Robin <robin.kertels@outlook.com> | 2018-04-13 00:00:00 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-14 21:56:24 +0300 |
commit | c2f062a02e0c803041be08f922c2d4ad234ca301 (patch) | |
tree | 7abe66770611967d028b049aa3c505ae8c614e14 /mesonbuild | |
parent | cb597adb0170a4818a4950ca9a4fe3f6d5a6c9d2 (diff) | |
download | meson-c2f062a02e0c803041be08f922c2d4ad234ca301.zip meson-c2f062a02e0c803041be08f922c2d4ad234ca301.tar.gz meson-c2f062a02e0c803041be08f922c2d4ad234ca301.tar.bz2 |
Fix encoding bug on Windows
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/mesonlib.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 9b00c28..8a2b67c 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -749,7 +749,9 @@ def expand_arguments(args): return expended_args def Popen_safe(args, write=None, stderr=subprocess.PIPE, **kwargs): - if sys.version_info < (3, 6) or not sys.stdout.encoding: + import locale + encoding = locale.getpreferredencoding() + if sys.version_info < (3, 6) or not sys.stdout.encoding or encoding.upper() != 'UTF-8': return Popen_safe_legacy(args, write=write, stderr=stderr, **kwargs) p = subprocess.Popen(args, universal_newlines=True, close_fds=False, |