adding encoding='utf-8' in generate_file() in result.py on line 403 to fix issue below:
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\HtmlTestRunner\runner.py", line 112, in run
result.generate_reports(self)
File "C:\Python37\lib\site-packages\HtmlTestRunner\result.py", line 388, in generate_reports
self.generate_file(testRunner, report_name_body, html_file)
File "C:\Python37\lib\site-packages\HtmlTestRunner\result.py", line 404, in generate_file
report_file.write(report)
File "C:\Python37\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 68858-68859: character maps to
adding encoding='utf-8' in generate_file() in result.py on line 403 to fix issue below:
Traceback (most recent call last): File "C:\Python37\lib\site-packages\HtmlTestRunner\runner.py", line 112, in run result.generate_reports(self) File "C:\Python37\lib\site-packages\HtmlTestRunner\result.py", line 388, in generate_reports self.generate_file(testRunner, report_name_body, html_file) File "C:\Python37\lib\site-packages\HtmlTestRunner\result.py", line 404, in generate_file report_file.write(report) File "C:\Python37\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 68858-68859: character maps to
Also see an issue in github about the same - https://github.com/oldani/HtmlTestRunner/issues/48