Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix UnicodeEncodeError occured when reports generated with special chars #90

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

trialhub123
Copy link
Contributor

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 - #48

@oldani oldani merged commit 8529dc3 into oldani:master Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants