Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
althonos opened this issue Mar 26, 2021 · 1 comment · Fixed by #467
Closed

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

althonos opened this issue Mar 26, 2021 · 1 comment · Fixed by #467
Labels
bug docs Issues related to documentation

Comments

@althonos
Copy link
Member

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

@althonos althonos added the bug label Mar 26, 2021
@althonos althonos added the docs Issues related to documentation label Mar 27, 2021
@althonos
Copy link
Member Author

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
Labels
bug docs Issues related to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant