diff options
Diffstat (limited to 'fs/iotools.py')
-rw-r--r-- | fs/iotools.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/iotools.py b/fs/iotools.py index bf91ec3..75197ec 100644 --- a/fs/iotools.py +++ b/fs/iotools.py @@ -160,7 +160,7 @@ def make_stream(name, if not binary: io_object = io.TextIOWrapper(io_object, - encoding=encoding, + encoding=encoding or 'utf-8', errors=errors, newline=newline, line_buffering=line_buffering,) @@ -170,7 +170,7 @@ def make_stream(name, def decode_binary(data, encoding=None, errors=None, newline=None): """Decode bytes as though read from a text file""" - return io.TextIOWrapper(io.BytesIO(data), encoding=encoding, errors=errors, newline=newline).read() + return io.TextIOWrapper(io.BytesIO(data), encoding=encoding or 'utf-8', errors=errors, newline=newline).read() def make_bytes_io(data, encoding=None, errors=None): |