Skip to content

'SubFS' object has no attribute 'writetext' #408

Closed

Description

@geoffjukes

Hi @willmcgugan

The subject says it all I think: 'SubFS' object has no attribute 'writetext'

settext works just fine, but I know it's been deprecated

Geoff

Activity

  1. added this to the v2.4.12 milestone on Sep 19, 2020
  2. self-assigned this
    on Sep 19, 2020
  3. althonos commented on Sep 19, 2020

    @althonos
    Member

    @geoffjukes : are you sure you are using the latest version of Pyfilesystem2? I checked fs.SubFS and it does have writetext. writetext is normally supported since v2.2.0.

  4. geoffjukes commented on Sep 19, 2020

    @geoffjukes
    ContributorAuthor

    @althonos Yup, using 2.4.11

  5. althonos commented on Sep 19, 2020

    @althonos
    Member

    Can you give me some code to reproduce? Trying to call writetext on a SubFS works without issue on v2.4.11 as far as I can tell:

    import fs
    print(fs.__version__)   # v2.4.11
    
    with fs.open_fs("temp://") as tmp:
        sub = tmp.makedir("subdir")
        print(type(sub))   # <class 'fs.subfs.SubFS'>
      
        sub.writetext("test", "this is a test")
        print(sub.readtext("test"))  # this is a test
  6. geoffjukes commented on Sep 19, 2020

    @geoffjukes
    ContributorAuthor

    @althonos It took a while to locate the project that I had the issue in, and then the Git history for the requirements.txt and the problematic file.

    It looks like, at the time of writing the ticket, the impacted project was running v2.1.0. I updated to 2.4.11 after reporting the issue, which (as you pointed out) is now fixed.

    Apologies for the wild goose chase!

  7. althonos commented on Sep 19, 2020

    @althonos
    Member

    No problem!

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions