From e8aef6962adae50b05710d5b687cc31be288cd4d Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Fri, 13 Nov 2020 18:57:07 +0000 Subject: [PATCH] Set output to UTF8 on windows (on Python >= 3.7) --- cibuildwheel/__main__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index 4e25befa..86ea12f0 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -54,6 +54,11 @@ def strtobool(val: str) -> bool: def main() -> None: + if sys.platform == 'win32' and hasattr(sys.stdout, 'reconfigure'): + # the encoding on Windows can be a 1-byte charmap, but all CIs support + # utf8, so we hardcode that + sys.stdout.reconfigure(encoding='utf8') + parser = argparse.ArgumentParser( description='Build wheels for all the platforms.', epilog='''