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

2013-07-25 Thread R. David Murray
R. David Murray added the comment: Is your patch backward? "Treat the path naturally" assume everyone agrees with you as to what is natural. It would be better, I think, to be explicit about it. -- ___ Python tracker

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

2013-07-07 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: ncoghlan -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

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

2013-07-07 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: -> ncoghlan nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

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

2013-05-25 Thread W. Owen Parry
W. Owen Parry added the comment: Patch as described above. Comments appreciated. -- keywords: +patch Added file: http://bugs.python.org/file30367/issue17545.patch ___ Python tracker

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

2013-05-21 Thread W. Owen Parry
W. Owen Parry added the comment: I suggest that this is a documentation issue. I have seen three classes of functions is os and os.path i - those which operate on path names only (os.path.join, os.path.dirname, etc) and do not depend on the state of the file system. Since these are string mani

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

2013-05-20 Thread Thomas Fenzl
Thomas Fenzl added the comment: I also looked into creating a patch and now I'm not convinced about the solution. While os.path.join accepts an empty string, the functions is os (e.g. stat and friends, utime, chown don't. os.walk doesn't throw an Exception, but generates an empty iterator on

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

2013-05-16 Thread W. Owen Parry
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

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

2013-04-25 Thread R. David Murray
R. David Murray added the comment: I don't know if the docs team replies to messages or not. I know that issues sometimes get opened up here that refer to emails to that alias. You can open an issue here yourself for the doc bug, if you want to. -- __

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

2013-04-25 Thread Bernard Lang
Bernard Lang added the comment: Thank you, David. BTW, I sent a message on april 20 to d...@python.org about a bug in the documentation regarding os.readlink(path) on page http://docs.python.org/2/library/os.html and proposing an alternative text. I got no reply. This was not long ago .

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

2013-04-20 Thread R. David Murray
Changes by R. David Murray : -- keywords: +easy stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

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

2013-03-26 Thread R. David Murray
R. David Murray added the comment: I'm inclined to agree with you. I believe '' represents the current directory in sys.path, for example. It ought to be easy to add this since issue 6095 is already fixed. -- versions: +Python 3.4 -Python 2.7 ___

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

2013-03-26 Thread Bernard Lang
Bernard Lang added the comment: Reply to R.David.Murray > See also issue 6095. You are right. I goofed, this is the issue I meant to point to. > $ ls '' > ls: cannot access : No such file or directory > So, the behavior is consistent with the shell. This is a fair remark. But still, giving a

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

2013-03-25 Thread R. David Murray
R. David Murray added the comment: By the way, you could write this as: localist = os.listdir(path if path else '.') -- ___ Python tracker ___

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

2013-03-25 Thread R. David Murray
R. David Murray added the comment: See also issue 6095. However: rdmurray@hey:~>ls '' ls: cannot access : No such file or directory So, the behavior is consistent with the shell. The shell has no equivalent to os.path.join. -- nosy: +r.david.murray _

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

2013-03-25 Thread Bernard Lang
New submission from Bernard Lang: The empty path '' is considered as an acceptable path in os.path.join, and works as a neutral prefix: print os.path.join('','aaa') ===> aaa which seems rather natural. But it raises an exception when used as a parameter to os.listdir. Logically, it should then