Skip to content

Standardize and enforce behaviour of FS.removetree("/") #471

Closed

Description

@althonos

FSTestCase never tests removetree("/"), so the behaviour is undefined at the moment. Dependending on the implementations;

  • fs.base.FS.removetree("/") will just remove all the entries in the root folder, but not the root folder itself
  • fs.wrapfs.WrapFS.removetree("/") will raise RemoveRootError

The first implementation is most better on a usage perspective, because it makes it easier to clear an entire filesystem, while not being too confusing provided this special case is well documented. However it may be harder to reproduce in dedicated
implementations of the removetree method (in OSFS or FTPFS for instance).

Activity

  1. althonos commented on Mar 27, 2021

    @althonos
    MemberAuthor

    removetree("/") will now remove every entry from the root folder, without removing the root folder itself. This is now tested for in fs.test.FSTestCase.

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

    bugdocsIssues related to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions