Skip to content

config.paths._find_home() doesn't check HOMESHARE correctly #8731

Closed

Description

@simon-ball

Importing Astropy on my system takes anywhere between 3-5 minutes due to checking the wrong network location for its Home directory.

The OS is Windows 10 1809 (the vast majority of users here are not comfortable with Linux environments), so os.name = 'nt'

The code in config.paths._find_dir() relies on the contents of os.environs. It searches for 'MSYSTEM' (does not exist), then 'HOMESHARE', which does. It then attempts to find %HOMESHARE%\.astropy, which does not exist and never will. %HOMESHARE% = \\server_root\, and I obviously do not have write permissions to create \\server-root\.astropy. Python hangs for several minutes waiting to timeout as it attempts to access \\server-root\.astropy\

It should instead attempt to find %HOMESHARE%\%HOMEPATH%\.astropy = \\server-root\user-name\.astropy, which does exist - or at least, will have write permission available. This would be equivalent to how the next IF statement uses the environment variable HOMEPATH.

Activity

  1. Cadair commented on May 20, 2019

    @Cadair
    Member

    Out of interest does https://github.com/ActiveState/appdirs do this correctly? I am planning on moving over to appsdirs see: #8245

  2. simon-ball commented on May 20, 2019

    @simon-ball
    Author

    import appdirs runs in ~10ms, it seems to be limited by the time to update the command prompt as much as anything else.

  3. Cadair commented on May 20, 2019

    @Cadair
    Member

    Does calling appdirs.user_config_dir() work in good time?

  4. simon-ball commented on May 20, 2019

    @simon-ball
    Author

    Yes, that executes pretty much instantly as well. It resolves to C:\Users\<user-name>\AppData\Local\.

    Note that the behaviour is different in that it resolves to a location in %HOMEPATH%, rather than %HOMESHARE%. That won't affect me - I don't modify any of Astropy's configuration files - but presumably it will for others.

  5. Cadair commented on May 20, 2019

    @Cadair
    Member

    Yeah I expect some subtle changes in semantics, but it should be much more reliable.

  6. pllim commented on Sep 2, 2020

    @pllim
    Member

    #8245 is still unresolved. Meanwhile, is #10705 good enough for now?

  7. embray commented on Sep 22, 2020

    @embray
    Member

    This is fixed by #10705, as the HOMESHARE environment variable is no longer used to determine the user's home directory on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions