Skip to content

open_fs("$HOME") does not work #524

Open
@tfeldmann

Description

@tfeldmann

I think os.expandvars needs to be called before abspath in the opener.

Example:

from fs import open_fs
>>> open_fs("~")
OSFS('/Users/tf')

>>> open_fs("$HOME")
...[snip]...
fs.errors.CreateFailed: root path '/Users/tf/Desktop/Users/tf' does not exist

I found the same unintuitive behavior on windows (open_fs("%USERPROFILE%")).
The user profile path is appended to the current working dir.

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