[issue3810] os.chdir() et al: is the path str or bytes?

Ezio Melotti report at bugs.python.org
Sat Jul 4 02:58:08 CEST 2009


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

At the beginning of the page[1] there's a note that says: "All functions
accepting path or file names accept both bytes and string objects, and
result in an object of the same type, if a path or file name is returned."
This applies to os.chdir() too (both work, however it doesn't return
anything).

The doc for os.listdir[2] now says: "This function can be called with a
bytes or string argument. In the bytes case, all filenames will be
listed as returned by the underlying API. In the string case, filenames
will be decoded using the file system encoding, and skipped if a
decoding error occurs." so the second problem you mentioned seems
already fixed.

[1]: http://docs.python.org/3.0/library/os.html#module-os
[2]: http://docs.python.org/3.0/library/os.html#os.listdir

----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3810>
_______________________________________


More information about the Python-bugs-list mailing list