From 0d06d884b1c886c9912c2921c1c1b5fbf6024299 Mon Sep 17 00:00:00 2001 From: Daniel Bair Date: Sat, 13 Jun 2020 10:01:04 +0700 Subject: [PATCH 1/2] Update diagnostics.py Detect utf-8 in python 3.8 --- aeneas/diagnostics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aeneas/diagnostics.py b/aeneas/diagnostics.py index 7d9e98a1..6f4e291f 100644 --- a/aeneas/diagnostics.py +++ b/aeneas/diagnostics.py @@ -56,9 +56,9 @@ def check_shell_encoding(cls): """ is_in_utf8 = True is_out_utf8 = True - if sys.stdin.encoding not in ["UTF-8", "UTF8"]: + if sys.stdin.encoding not in ["UTF-8", "UTF8", "utf-8", "utf8"]: is_in_utf8 = False - if sys.stdout.encoding not in ["UTF-8", "UTF8"]: + if sys.stdout.encoding not in ["UTF-8", "UTF8", "utf-8", "utf8"]: is_out_utf8 = False if (is_in_utf8) and (is_out_utf8): gf.print_success(u"shell encoding OK") From 26a4b999ad0ca7f0ca4a302eb3da1899e70d7b7a Mon Sep 17 00:00:00 2001 From: Daniel Bair Date: Mon, 15 Jun 2020 10:40:21 +0700 Subject: [PATCH 2/2] Update abstract_cli_program.py Detect utf-8 in python3.8 --- aeneas/tools/abstract_cli_program.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aeneas/tools/abstract_cli_program.py b/aeneas/tools/abstract_cli_program.py index be5bb2fa..b5b9fadd 100644 --- a/aeneas/tools/abstract_cli_program.py +++ b/aeneas/tools/abstract_cli_program.py @@ -295,10 +295,10 @@ def run(self, arguments, show_help=True): if self.use_sys: # check that sys.stdin.encoding and sys.stdout.encoding are set to utf-8 if not gf.FROZEN: - if sys.stdin.encoding not in ["UTF-8", "UTF8"]: + if sys.stdin.encoding not in ["UTF-8", "UTF8", "utf-8", "utf8"]: self.print_warning(u"The default input encoding is not UTF-8.") self.print_warning(u"You might want to set 'PYTHONIOENCODING=UTF-8' in your shell.") - if sys.stdout.encoding not in ["UTF-8", "UTF8"]: + if sys.stdout.encoding not in ["UTF-8", "UTF8", "utf-8", "utf8"]: self.print_warning(u"The default output encoding is not UTF-8.") self.print_warning(u"You might want to set 'PYTHONIOENCODING=UTF-8' in your shell.") # decode using sys.stdin.encoding