This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.path.expanduser documentation wrt. empty $HOME
Type: Stage:
Components: Documentation Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: calvin, georg.brandl, georg.brandl, rhettinger
Priority: normal Keywords:

Created on 2005-05-02 15:02 by calvin, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
expanduser-doc.diff georg.brandl, 2005-06-05 12:29
Messages (4)
msg25202 - (view) Author: Bastian Kleineidam (calvin) Date: 2005-05-02 15:02
If $HOME is unset, an initial "~" should not be
expanded according to the documentation. But instead it
somehow is expanded, perhaps through the pwd module:

$ env -u HOME python -c "import os.path; print
os.path.expanduser('~/foo')"
/home/calvin/foo

The result should be "~/foo" instead of "/home/calvin/foo".

I suggest adjusting the documentation to state the also
a single "~" is looked up in the pwd module, not only
"~user".
msg25203 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-06-05 12:29
Logged In: YES 
user_id=1188172

Attached a patch which fixes the docs. Okay to checkin?
msg25204 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-08-24 05:16
Logged In: YES 
user_id=80475

Strike the comma before the final "or".

After you post this, put a note on your todo list to check
its appearance in the HTML docs whenever Fred runs an update:
   
    http://www.python.org/dev/doc/devel/
msg25205 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-08-24 07:28
Logged In: YES 
user_id=1188172

Okay, committed as Doc/lib/libposixpath.py 1.42, 1.40.2.2.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 41936
2005-05-02 15:02:43calvincreate