[cli] Set non-tty output encoding to UTF-8

Closes #551 and #554
This commit is contained in:
derrod 2023-05-28 00:16:21 +02:00
parent 4bed49e7e1
commit 8b2809779f

View file

@ -2539,6 +2539,10 @@ class LegendaryCLI:
def main():
# Set output encoding to UTF-8 if not outputting to a terminal
if not stdout.isatty():
stdout.reconfigure(encoding='utf-8')
parser = argparse.ArgumentParser(description=f'Legendary v{__version__} - "{__codename__}"')
parser.register('action', 'parsers', HiddenAliasSubparsersAction)