Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


cleanup utils.path.get_home_dir #810

minrk opened this Issue · 0 comments

1 participant

Min RK
Min RK

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
Brian E. Granger ellisonbg referenced this issue from a commit
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.