On Tue, Sep 30, 2008 at 8:47 AM, Bill Janssen <[EMAIL PROTECTED]> wrote: > Victor Stinner <[EMAIL PROTECTED]> wrote: > >> - listdir(unicode) -> only unicode, *skip* invalid filenames >> (as asked by Guido) > > Is there an option listdir(bytes) which will return *all* filenames (as > byte sequences)? Otherwise, this seems troubling to me; *something* > should be returned for filenames which can't be represented, even if > it's only None.
Yes, os.listdir() becomes polymorphic -- if you pass it a pathname in bytes the output is in bytes and it will return everything exactly as the underlying syscall returns it to you. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com