diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-05-21 09:02:26 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2018-05-21 18:03:42 +0000 |
commit | 2ecf69f7731083f5d8e3765fe1965a8a8cb11d9c (patch) | |
tree | 7facdf43b1206698688fe63a146d4d74f4306b5d /test/subprocesstest.py | |
parent | e6c832c49a66dc88b305574d8875eb811a58124e (diff) |
Test: Be more paranoid about our log output.
Run our CTest tests with PYTHONIOENCODING=UTF-8.
If someone runs our tests manually and their output encoding isn't
UTF-8, print replacement characters instead of failing with an error.
Open our log files with "errors='backslashreplace'" in case their
contents aren't UTF-8.
Change-Id: Ifa4d12c2b5e272cf3903f3e0c6102e4d961562f1
Reviewed-on: https://code.wireshark.org/review/27686
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'test/subprocesstest.py')
-rw-r--r-- | test/subprocesstest.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/subprocesstest.py b/test/subprocesstest.py index 61bab5f970..8fae5da038 100644 --- a/test/subprocesstest.py +++ b/test/subprocesstest.py @@ -182,7 +182,7 @@ class SubprocessTestCase(unittest.TestCase): # Leave some evidence behind. self.cleanup_files = [] print('\nProcess output for {}:'.format(self.id())) - with io.open(self.log_fname, 'r', encoding='UTF-8') as log_fd: + with io.open(self.log_fname, 'r', encoding='UTF-8', errors='backslashreplace') as log_fd: for line in log_fd: sys.stdout.write(line) for filename in self.cleanup_files: |