Skip to content

Conversation

@althonos
Copy link
Member

@althonos althonos commented Mar 26, 2021

Type of changes

  • Bug fix
  • Tests

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

This PR fixes the following issues:

  • fs.wrap.WrapReadOnly did not wrap the removetree method, meaning a filesystem could still be wiped if this command was called. Closes WrapReadOnly does not wrap removetree #468 .
  • fs.wrap.WrapCachedDir methods isdir and isfile would raise ResourceNotFound instead of returning False on non-existing paths.

I also added more tests for these two classes, and in particular a test making sure fs.copy, fs.move and fs.mirror respect WrapReadOnly semantics; this is to avoid any new undetected removal that could occur if #429 or similar improvements are added which could use os functions to improve performance in various places when given filesystems with a syspath.

@althonos althonos added the bug label Mar 26, 2021
@althonos althonos force-pushed the readonly-removetree branch from f7a5f7b to 4a614cf Compare March 26, 2021 00:50
@coveralls
Copy link

coveralls commented Mar 26, 2021

Coverage Status

Coverage increased (+0.008%) to 95.329% when pulling 235b56a on readonly-removetree into 94f0323 on master.

@althonos althonos merged commit 99d5314 into master Mar 26, 2021
@althonos althonos deleted the readonly-removetree branch March 26, 2021 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WrapReadOnly does not wrap removetree

2 participants