[issue26429] os.path.dirname returns empty string instead of "." when file is in current directory

Serhiy Storchaka report at bugs.python.org
Wed Feb 24 13:16:00 EST 2016


Serhiy Storchaka added the comment:

This is documented behavior and changing this will break existing code (for example see the implementation of glob.glob()).

If you need this, a workaround is simple and idiomatic: ``os.path.dirname(path) or os.curdir``.

----------
nosy: +serhiy.storchaka
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list