Skip to content

Commit

Permalink
Fixes UnicodeEncodeError: 'charmap' codec can't encode characters in …
Browse files Browse the repository at this point in the history
…position N

Change-Id: Ib11e0cab27699a3563eea0fc5707c74ef79d919d
  • Loading branch information
Artur Spirin committed Aug 17, 2023
1 parent cd44aee commit 3eb0b68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="test_junkie",
version="0.8a6",
version="0.8a7",
author="Artur Spirin",
author_email="[email protected]",
description="Modern Testing Framework",
Expand All @@ -23,6 +23,7 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Quality Assurance",
Expand Down
9 changes: 7 additions & 2 deletions test_junkie/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,13 @@ def parse_exception(value):
for index in range(param_data["retry"]):
trace = param_data["tracebacks"][index]
if trace is not None:
trace = ":: Traceback: {}".format(CliUtils.format_color_string(
parse_exception(trace.encode('utf8', errors="replace").decode("utf8")), "red"))
trace = ":: Traceback: {}".format(
CliUtils.format_color_string(
parse_exception(
trace.encode('utf8', errors="replace").decode("unicode-escape")
), "red"
)
)
else:
trace = ""
print("\t |__ run #{num} [{status}] [{runtime:0.2f}s] {trace}"
Expand Down

0 comments on commit 3eb0b68

Please sign in to comment.