mirror of
https://github.com/derrod/legendary.git
synced 2024-06-18 18:45:08 +12:00
Fix encoding on non-pipe stdout
This commit is contained in:
parent
362287543b
commit
8d7eb45bca
|
@ -40,6 +40,8 @@ logger = logging.getLogger('cli')
|
||||||
|
|
||||||
class LegendaryCLI:
|
class LegendaryCLI:
|
||||||
def __init__(self, override_config=None, api_timeout=None):
|
def __init__(self, override_config=None, api_timeout=None):
|
||||||
|
if not stdout.isatty():
|
||||||
|
stdout.reconfigure(encoding='utf-8')
|
||||||
self.core = LegendaryCore(override_config, timeout=api_timeout)
|
self.core = LegendaryCore(override_config, timeout=api_timeout)
|
||||||
self.logger = logging.getLogger('cli')
|
self.logger = logging.getLogger('cli')
|
||||||
self.logging_queue = None
|
self.logging_queue = None
|
||||||
|
|
Loading…
Reference in a new issue