Move encoding switch to before the unicode decision is made

This commit is contained in:
Joe Rickerby
2020-11-13 19:04:02 +00:00
parent e8aef6962a
commit a732525084
2 changed files with 5 additions and 5 deletions
-5
View File
@@ -54,11 +54,6 @@ 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='''
+5
View File
@@ -34,6 +34,11 @@ class Logger:
active_fold_group_name: Optional[str] = None
def __init__(self):
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')
self.unicode_enabled = file_supports_unicode(sys.stdout)
if 'AZURE_HTTP_USER_AGENT' in os.environ: