Fix encoding bug on Windows

pull/3410/merge
Robin 7 years ago committed by Jussi Pakkanen
parent cb597adb01
commit c2f062a02e
  1. 4
      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,

Loading…
Cancel
Save