Skip to content

Commit

Permalink
fix issue with colorama on Gitbash/windows
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceCabs committed Sep 6, 2021
1 parent 6ba0416 commit a932b52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gaunit/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.2"
__version__ = "0.5.3"
11 changes: 7 additions & 4 deletions gaunit/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,13 @@ def _print_summary(self):
"GA events found: total:%s / ok:%s / missing:%s"
% (total_found, expected_found, missing)
)
if False in chcklst:
print("\N{Cross Mark} FAILED: events missing")
else:
print("\N{Heavy Check Mark} OK: all expected events found")
try:
if False in chcklst:
print("\N{Cross Mark} FAILED: events missing")
else:
print("\N{Heavy Check Mark} OK: all expected events found")
except UnicodeEncodeError:
pass

def print_actual_events(self):
"""pretty print list of analytics hits from test case
Expand Down

3 comments on commit a932b52

@mara004
Copy link

@mara004 mara004 commented on a932b52 Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be a workaround, but not a real fix.

@VinceCabs
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mara004,

You're right. that's why I opened this issue tartley/colorama#319 in colorama project.
If you have any alternative, I'll seriously look into it.

@mara004
Copy link

@mara004 mara004 commented on a932b52 Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you say, the source of the issue probably is in colorama, but the problem is that, in case of a UnicodeEncodeError, your print messages won't show up at all, which might be confusing. So perhaps it would be a better workaround to remove the problematic characters (or to fall back to prints wihtout these) until colorama address the issue.

Please sign in to comment.