Skip to content

Commit

Permalink
Fix missing emoji (#3181)
Browse files Browse the repository at this point in the history
(cherry picked from commit e6445cd)
  • Loading branch information
raubitsj committed Jan 31, 2022
1 parent 08c6c2c commit d684ea8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions wandb/sdk/wandb_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2138,10 +2138,7 @@ def _append_history(self, logs: str, as_html: bool = False) -> str:
return logs

# Only print sparklines if the terminal is utf-8
# In some python 2.7 tests sys.stdout is a 'cStringIO.StringO' object
# which doesn't have the attribute 'encoding'
encoding = getattr(sys.stdout, "encoding", None)
if not encoding or encoding.upper() not in ("UTF_8", "UTF-8",):
if not is_unicode_safe(sys.stdout):
return logs

logger.info("rendering history")
Expand Down
2 changes: 1 addition & 1 deletion wandb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ def is_unicode_safe(stream):
"""returns true if the stream supports UTF-8"""
if not hasattr(stream, "encoding"):
return False
return stream.encoding == "UTF-8"
return stream.encoding.lower() in {"utf-8", "utf_8"}


def _has_internet():
Expand Down

0 comments on commit d684ea8

Please sign in to comment.