[Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

Terry Reedy tjreedy at udel.edu
Wed Apr 29 22:59:57 CEST 2009

Glenn Linderman wrote:
> On approximately 4/29/2009 4:36 AM, came the following characters from 
> the keyboard of Cameron Simpson:
>> On 29Apr2009 02:56, Glenn Linderman <v+python at 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).
> Me too.

Sounds like an issue for the tracker.

More information about the Python-Dev mailing list