From d5e19db5e6f1cdfddef25cc04e742ec41f372bde Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 11 May 2014 16:03:27 +0200 Subject: [PATCH] Don't re-encode by filesystem encoding --- libs/scandir/scandir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/scandir/scandir.py b/libs/scandir/scandir.py index 1e34f8e..9761e9f 100644 --- a/libs/scandir/scandir.py +++ b/libs/scandir/scandir.py @@ -365,7 +365,7 @@ elif sys.platform.startswith(('linux', 'darwin')) or 'bsd' in sys.platform: """Like os.listdir(), but yield DirEntry objects instead of returning a list of names. """ - dir_p = opendir(path.encode(file_system_encoding)) + dir_p = opendir(path) if not dir_p: raise posix_error(path) try: @@ -376,7 +376,7 @@ elif sys.platform.startswith(('linux', 'darwin')) or 'bsd' in sys.platform: raise posix_error(path) if not result: break - name = entry.d_name.decode(file_system_encoding) + name = entry.d_name if name not in ('.', '..'): yield PosixDirEntry(path, name, entry.d_type) finally: