[New-bugs-announce] [issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

Ezio Melotti report at bugs.python.org
Sun May 3 15:45:01 CEST 2009


New submission from Ezio Melotti <ezio.melotti at gmail.com>:

On Windows, with Python2/Python3, os.listdir('')/os.listdir(b'') list
the content of the current working directory and
os.listdir(u'')/os.listdir('') the content of C:\.

On Linux the error "OSError: [Errno 2] No such file or directory: ''" is
raised.

I also noticed that os.listdir('C:') (without the \) lists the content
of the cwd too.

----------
components: Library (Lib), Windows
messages: 87045
nosy: ezio.melotti
severity: normal
status: open
title: On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

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


More information about the New-bugs-announce mailing list