Browse Source

Revert "Don't re-encode by filesystem encoding"

This reverts commit d5e19db5e6.
pull/3252/head
Ruud 11 years ago
parent
commit
fe9998fb9d
  1. 4
      libs/scandir/scandir.py

4
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:

Loading…
Cancel
Save