Message179214
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. |
|
Date |
User |
Action |
Args |
2013-01-06 19:59:24 | ibshields | set | recipients:
+ ibshields, georg.brandl, r.david.murray |
2013-01-06 19:59:24 | ibshields | set | messageid: <1357502364.51.0.401493883499.issue16877@psf.upfronthosting.co.za> |
2013-01-06 19:59:24 | ibshields | link | issue16877 messages |
2013-01-06 19:59:24 | ibshields | create | |
|