New submission from Jonas Eriksson: Only tested on marked python versions. Checked the code in hg (a5681f50bae2) and did not see anything related to this in the current development version.
Essentially, what I see is this: >>> os.path.dirname("asdf") '' >>> os.path.dirname("./asdf") '.' >>> What I expect is the same output as from the unix command dirname: $ dirname asdf . $ dirname ./asdf . $ The change is quite straight forwards, Lib/posixpath.py needs something like if head = "": head = ".", and Lib/ntpath.py something similar. Now, this bug is a tricky one since it alters the behavior of dirname. However, I cannot see any case where "" would be useful and have seen at least one bug because of this behaviour because the return value "" is treated like an error. So I gracefully hand over the final decision to you :) ---------- components: Library (Lib) messages: 193662 nosy: Jonas.Eriksson priority: normal severity: normal status: open title: os.path.dirname() does not behave as expected for path without /:es type: behavior versions: Python 2.7, Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18547> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com