[issue17545] os.listdir and os.path.join inconsistent on empty path

W. Owen Parry report at bugs.python.org
Thu May 16 20:43:27 CEST 2013


W. Owen Parry added the comment:

I started working on a patch for this, but the more I think about it the less I am convinced it is wanted.

The issue requests that os.listdir('') be equal to os.listdir('.')

The given example of os.path.join doesn't follow this:

>>> os.path.join('','aaa')
'aaa'
>>> os.path.join('.','aaa')
'.\\aaa'

This makes sense: prepending an empty path should be a no-op, while prepending the current directory has a different meaning.

It seems consistent in this case that listing an empty path and listing the current directory should have different meanings.

Is there any other traction/use case for this change?

----------
nosy: +woparry

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


More information about the Python-bugs-list mailing list