Eryk Sun added the comment: os.path.dirname is documented as the first element of os.path.split, which in turn is documented to be empty when there's no slash in the path.
An empty string is treated as the current directory by os.path.abspath. This is in line with an empty element in the PATH environment variable. Also, Python's sys.path uses an empty string for the current directory. If you want a dot for display and logging purposes, normalize via os.path.normpath: >>> os.path.normpath('') '.' ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26429> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com