From c80f76cbca26e1d6d173bc39365e18f842886f58 Mon Sep 17 00:00:00 2001 From: Chris Allan Date: Mon, 27 Jul 2020 19:07:30 +0100 Subject: [PATCH 1/2] Use UTF-8 when attempting to check log files --- src/omero/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/omero/cli.py b/src/omero/cli.py index 4f2328e2c..231b5e807 100755 --- a/src/omero/cli.py +++ b/src/omero/cli.py @@ -1115,7 +1115,7 @@ def _exists(self, p): r'error:?\s') warn = 0 err = 0 - for l in p.lines(): + for l in p.lines(encoding='UTF-8'): # ensure errors/warnings search is case-insensitive lcl = l.lower() if re.match(warn_regex, lcl): From 124e2c2c521da04714d40b05b5d37e248778e997 Mon Sep 17 00:00:00 2001 From: Chris Allan Date: Wed, 29 Jul 2020 12:33:32 +0100 Subject: [PATCH 2/2] Use an error handler instead --- src/omero/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/omero/cli.py b/src/omero/cli.py index 231b5e807..4a27c3995 100755 --- a/src/omero/cli.py +++ b/src/omero/cli.py @@ -1115,7 +1115,7 @@ def _exists(self, p): r'error:?\s') warn = 0 err = 0 - for l in p.lines(encoding='UTF-8'): + for l in p.lines(errors="surrogateescape"): # ensure errors/warnings search is case-insensitive lcl = l.lower() if re.match(warn_regex, lcl):