Skip to content

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

Closed
@althonos

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).

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