Skip to content

Commit

Permalink
document default encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Dec 21, 2024
1 parent 73294c9 commit 837a6c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/monty/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ def zopen(
This function wraps around `[bz2/gzip/lzma].open` and `open`
to deal intelligently with compressed or uncompressed files.
Supports context manager:
`with zopen(filename, mode="rt", ...)`.
`with zopen(filename, mode="rt", ...)`
Important Notes:
- Default `mode` should not be used, and would not be allow
in future versions.
- Always explicitly specify binary/text in `mode`, i.e.
always pass `t` or `b` in `mode`, implicit binary/text
mode would not be allow in future versions.
- Always provide an explicit `encoding` in text mode.
- Always provide an explicit `encoding` in text mode, it would
be set to UTF-8 by default otherwise.
Args:
filename (str | Path): The file to open.
Expand Down

0 comments on commit 837a6c1

Please sign in to comment.