Ian Shields added the comment:

David, Tilde expansion is different to globbing. Globbing in Python doesn't 
automatically do tilde expansion either.
>>> glob.glob("~")
[]

Looking at the documentation, I don't think it would be practical to add 
documentation to each affected function - there are too many. Apart from 
abspath and realpath (which started this conversation), there are join, isdir, 
isfile, isabs, and many others in os.path. posixpath and the other path 
handling modules.

Maybe a note at the top of the module documentation (e.g. 
http://docs.python.org/3/library/os.path.html) which has two notes already. 
Something along the line of:

Unlike many shells, Python does not automatically do tilde expansion or 
variable substitution in paths. Use expanduser for tilde expansion or 
expandvars for variable substitution.

Or just simply
Use expanduser for tilde expansion or expandvars for variable substitution in 
paths as the other path functions do not do this automatically.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16877>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to