Skip to content

TempFS.__enter__ returns object of type FS instead of TempFS #580

Description

@dsoulis

Example

with TempFS() as temp_fs:
   temp_fs_sys_path = temp_fs.root_path  # raises AttributeError since temp_fs is of type FS

To get around this you need to do:
temp_fs_root_sys_path = temp_fs.getsyspath('')

There may be other OSFS/TempFS specific attributes that may fail due to this.
TempFS.__enter__ return type should be TempFS, not FS.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions