diff --git a/CHANGES.txt b/CHANGES.txt index 9bfe145..6e68a86 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -101,6 +101,6 @@ 0.5.3: * Implemented scandir in listdir if available - + * Fix for issue where local.getpreferredencoding returns empty string diff --git a/fs/__init__.py b/fs/__init__.py index c250eac..2ddb779 100644 --- a/fs/__init__.py +++ b/fs/__init__.py @@ -15,7 +15,7 @@ """ -__version__ = "0.5.3a0" +__version__ = "0.5.4a1" __author__ = "Will McGugan (will@willmcgugan.com)" # provide these by default so people can use 'fs.path.basename' etc. 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): diff --git a/setup.py b/setup.py index f9864cc..aafbf67 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import sys PY3 = sys.version_info >= (3,) -VERSION = "0.5.3a0" +VERSION = "0.5.4a1" COMMANDS = ['fscat', 'fsinfo',