cleanup utils.path.get_home_dir #810

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

1 participant

@minrk
IPython member

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.

@minrk minrk closed this in 351c8fc Nov 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment