Skip to content

Commit

Permalink
🩹 (io) Ensure bytes for stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwoerpel committed Jun 17, 2024
1 parent 1411978 commit 6870db9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion anystore/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ def smart_read(uri: Uri, mode: str | None = DEFAULT_MODE, **kwargs) -> Any:


def smart_write(
uri, content: bytes | str, mode: str | None = DEFAULT_WRITE_MODE, **kwargs
uri: Uri, content: bytes | str, mode: str | None = DEFAULT_WRITE_MODE, **kwargs
) -> None:
if uri == "-":
if isinstance(content, str):
content = content.encode()
with smart_open(uri, mode, **kwargs) as fh:
fh.write(content)

0 comments on commit 6870db9

Please sign in to comment.