Skip to content
This repository

cleanup utils.path.get_home_dir #810

Closed
minrk opened this Issue September 20, 2011 · 0 comments

1 participant

Min RK
Min RK
Owner

We have lots of manual code in utils.path.get_home_dir(), but most of it is either duplicate or inferior to os.path.expanduser('~').

I don't know about the failure cases of the builtin func, but ours is easily broken with:

$> unset HOME
$> ipython

Traceback (most recent call last):
    ...
IPython.utils.path.HomeDirError: Undefined $HOME, IPython cannot proceed.

os.path.expanduser(), on the other hand, still works in this case because it falls back on the password db if HOME is unset, rather than falling back on HOME in a subprocess, which is also removed by the above unset. It also probably makes a better choice on Windows, about which we have had issues.

Min RK minrk closed this in 351c8fc November 23, 2011
Brian E. Granger ellisonbg referenced this issue from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.