Feature #2466
HTML Test Runner fails with Python 3
Start date:
10/07/2019
Due date:
% Done:
100%
Associated revisions
Improving Python 3 support
Reference #2466:
Improving Python 3 support
Reference #2466:
History
#1 Updated by Luke Murphey about 5 years ago
Observations:
- REPORT_TEST_WITH_OUTPUT_TMPL was causing an issue because it had unicode in it
- The output
- What happens when I use just r?"
[exec] File "unit.py", line 460, in <module> [exec] run_tests() [exec] File "unit.py", line 457, in run_tests [exec] test_runner.run(unittest.TestSuite(suites)) [exec] File "/Users/lmurphey/git/splunk-file-info/tests/HTMLTestRunner.py", line 648, in run [exec] self.generateReport(test, result) [exec] File "/Users/lmurphey/git/splunk-file-info/tests/HTMLTestRunner.py", line 695, in generateReport [exec] report = self._generate_report(result) [exec] File "/Users/lmurphey/git/splunk-file-info/tests/HTMLTestRunner.py", line 759, in _generate_report [exec] self._generate_report_test(rows, cid, tid, n, t, o, e) [exec] File "/Users/lmurphey/git/splunk-file-info/tests/HTMLTestRunner.py", line 805, in _generate_report_test [exec] status = self.STATUS[n], [exec] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 557: ordinal not in range(128)
- What happens when I use "six.text_type()" and r:
[exec] Traceback (most recent call last): [exec] File "unit.py", line 8, in <module> [exec] import HTMLTestRunner [exec] File "/Users/lmurphey/git/splunk-file-info/tests/HTMLTestRunner.py", line 148, in <module> [exec] class Template_mixin(object): [exec] File "/Users/lmurphey/git/splunk-file-info/tests/HTMLTestRunner.py", line 500, in Template_mixin [exec] """) [exec] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 555: ordinal not in range(128)
- I get the same error as above using just six.text_type():
- What happens when I clear the template?
- It works
- The customized close character was the problem
- Output redirector is failing: "'unicode' does not have the buffer interface"
- Removing the unicode conversion code fixed it
#2 Updated by Luke Murphey about 5 years ago
- Target version set to 1.4.3
#3 Updated by Luke Murphey about 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100