(original) (raw)

os.DirEntry doesn't support bytes: os.scandir() only accept str. It's a deliberate choice.

I strongly suggest to only support Unicode for filenames in Python 3\. So \_\_fspath\_\_ must only return str, or a TypeError must be raised.

Victor