From fe9998fb9d229e76cf3ebb0893132eea39e3e7d2 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 11 May 2014 18:53:13 +0200 Subject: [PATCH] Revert "Don't re-encode by filesystem encoding" This reverts commit d5e19db5e6f1cdfddef25cc04e742ec41f372bde. --- 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 9761e9fb..1e34f8e5 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) + dir_p = opendir(path.encode(file_system_encoding)) 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 + name = entry.d_name.decode(file_system_encoding) if name not in ('.', '..'): yield PosixDirEntry(path, name, entry.d_type) finally: