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

HTML report fails due to codec errors #182

Closed
devdanzin opened this issue Jul 5, 2023 · 0 comments · Fixed by #183
Closed

HTML report fails due to codec errors #182

devdanzin opened this issue Jul 5, 2023 · 0 comments · Fixed by #183

Comments

@devdanzin
Copy link
Collaborator

When writing HTML reports using wily report --format HTML, UnicodeEncodeError can be raised from characters in user names (probably from message text too). I suppose the error coming from charmap means this is Windows only?

To Reproduce

  1. Checkout wily's repo
  2. wily build on wily's source
  3. wily report --format HTML src\wily\commands\report.py loc
  4. Errors with UnicodeEncodeError: 'charmap' codec can't encode character '\u0141' in position 5486: character maps to <undefined> due to the name Łukasz Skarżyński.

Expected behavior
wily should handle the error, preferably by using xmlcharrefreplace which just works for HTML content.

Desktop (please complete the following information):

  • OS: Windows
  • Version 1.24.2

I have a trivial fix, will submit PR.

tonybaloney added a commit that referenced this issue Jul 10, 2023
Use xmlcharrefreplace to handle codec errors in html report writing (fix #182)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant