HOMESHARE not a good choice for "writable homedir" on Windows #747

Closed
bergtholdt opened this Issue Aug 30, 2011 · 1 comment

Projects

None yet

2 participants

@bergtholdt

in IPython/utils/path.py(234), the homedir is set by default to:

        homedir = env['HOMESHARE']

However as a user I cannot change HOMESHARE environment variable (it is reset after next login) and it is on our installation a path to a network drive that I cannot write to. I'd rather have this configurable or as first choice use HOME or IPYTHON_HOME or something else which I can make persistent as a user environment variable and only fall back to HOMESHARE which might work for other users.

@minrk
Member
minrk commented Aug 30, 2011

master should check whether the dir is writable, and skip it if not. But if it doesn't make sense for it to be the default, perhaps it should drop behind HOME. I don't know much about Windows environments, but a quick skim of The Googles seems to suggest that HOMESHARE isn't ever right, and it should be %HOMESHARE%%HOMEPATH%, if we are using it.

If you want to set the IPython directory, you can always use the IPYTHON_DIR env variable.

@minrk minrk closed this in 351c8fc Nov 24, 2011
@stefanv stefanv pushed a commit to stefanv/ipython that referenced this issue Nov 30, 2011
@minrk minrk defer to stdlib for path.get_home_dir()
We have elaborate and fragile logic for determining
home dir, and it is ultimately less reliable than the stdlib behavior
used for `os.path.expanduser('~')`.  This commit defers to that in
all cases other than a bundled Python in py2exe/py2app environments.

The one case where the default guess will *not* be correct, based on
inline comments, is on WinHPC, where all paths must be UNC (`\\foo`), and
thus HOMESHARE is the logical first choice.  However, HOMESHARE is
the wrong answer in approximately all other cases where it is defined,
and the fix for WinHPC users is the trivial `HOME=%HOMESHARE%`.

This removes the various tests of our Windows path resolution logic,
which are no longer relevant. Further, $HOME is used by the stdlib
as first priority on *all* platforms, so tests for this behavior are
no longer posix-specific.

closes gh-970
closes gh-747
b5ca646
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@minrk minrk defer to stdlib for path.get_home_dir()
We have elaborate and fragile logic for determining
home dir, and it is ultimately less reliable than the stdlib behavior
used for `os.path.expanduser('~')`.  This commit defers to that in
all cases other than a bundled Python in py2exe/py2app environments.

The one case where the default guess will *not* be correct, based on
inline comments, is on WinHPC, where all paths must be UNC (`\\foo`), and
thus HOMESHARE is the logical first choice.  However, HOMESHARE is
the wrong answer in approximately all other cases where it is defined,
and the fix for WinHPC users is the trivial `HOME=%HOMESHARE%`.

This removes the various tests of our Windows path resolution logic,
which are no longer relevant. Further, $HOME is used by the stdlib
as first priority on *all* platforms, so tests for this behavior are
no longer posix-specific.

closes gh-970
closes gh-747
75ed92d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment