On 29Apr2009 02:56, Glenn Linderman <v+pyt...@g.nevcal.com> wrote: > os.listdir(b"") > > I find that on my Windows system, with all ASCII path file names, that I > get quite different results when I pass os.listdir an empty str vs an > empty bytes. > > Rather than keep you guessing, I get the root directory contents from > the empty str, and the current directory contents from an empty bytes. > That is rather unexpected. > > So I guess I'd better suggest that a specific, equivalent directory name > be passed in either bytes or str form.
I think you may have uncovered an implementation bug rather than an encoding issue (because I'd expect "" and b"" to be equivalent). In ancient times, "" was a valid UNIX name for the working directory. POSIX disallows that, and requires people to use ".". Maybe you're seeing an artifact; did python move from UNIX to Windows or the other way around in its porting history? I'd guess the former. Do you get differing results from listdir(".") and listdir(b".") ? How's python2 behave for ""? (Since there's no b"" in python2.) Cheers, -- Cameron Simpson <c...@zip.com.au> DoD#743 http://www.cskk.ezoshosting.com/cs/ 'Supposing a tree fell down, Pooh, when we were underneath it?' 'Supposing it didn't,' said Pooh after careful thought. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com