We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66df6aa commit 2e052e4Copy full SHA for 2e052e4
1 file changed
wandb/util.py
@@ -1376,9 +1376,8 @@ def uri_from_path(path: Optional[str]) -> str:
1376
1377
def is_unicode_safe(stream: TextIO) -> bool:
1378
"""returns true if the stream supports UTF-8"""
1379
- if not hasattr(stream, "encoding"):
1380
- return False
1381
- return stream.encoding.lower() in {"utf-8", "utf_8"}
+ encoding = getattr(stream, "encoding", None)
+ return encoding.lower() in {"utf-8", "utf_8"} if encoding else False
1382
1383
1384
def _has_internet() -> bool:
0 commit comments