diff --git a/os/metadata.txt b/os/metadata.txt index 150da5d2..c76eedb4 100644 --- a/os/metadata.txt +++ b/os/metadata.txt @@ -1,4 +1,4 @@ srctype = micropython-lib type = package -version = 0.0.8 +version = 0.0.9 author = Paul Sokolovsky diff --git a/os/os/__init__.py b/os/os/__init__.py index 3af7ca5f..6da0aaef 100644 --- a/os/os/__init__.py +++ b/os/os/__init__.py @@ -93,10 +93,13 @@ def ilistdir_ex(path="."): yield dirent def listdir(path="."): + is_bytes = type(path) is bytes res = [] for dirent in ilistdir_ex(path): fname = str(dirent[4].split('\0', 1)[0], "ascii") if fname != "." and fname != "..": + if is_bytes: + fname = fsencode(fname) res.append(fname) return res diff --git a/os/setup.py b/os/setup.py index 2813a62f..bbc9ccd6 100644 --- a/os/setup.py +++ b/os/setup.py @@ -6,7 +6,7 @@ from setuptools import setup setup(name='micropython-os', - version='0.0.8', + version='0.0.9', description='os module for MicroPython', long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.", url='https://github.com/micropython/micropython/issues/405',