[issue14550] os.path.abspath() returns physical path, not logical path.

Craig Sawyer report at bugs.python.org
Wed Apr 11 19:33:37 CEST 2012


Craig Sawyer <csawyer at yumaed.org> added the comment:

Antoine,

I see your point about getcwd() not having symlinks, doesn't mean any path outside of getcwd() might have symlinks, and I agree this is true.  I apologize.

As for which one to choose, it should choose based on PWD (i.e. the current working directory's parent directories).  I'd love to see something like os.path.abspath(path, logical=True) which would use PWD instead of getcwd() to get the current working directories path.  i.e. symlinks are honored within the current path. From a language perspective this probably means needing os.getpwd() or something similar, that would return the pwd information.

I know pwd isn't always guaranteed to be around, so the failsafe should be to return getcwd() in that case, just like os.path.abspath() does now.

----------

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


More information about the Python-bugs-list mailing list