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

Update movedir methods of WrapFS to use the delegate FS method #511

Merged
merged 3 commits into from
Feb 7, 2022

Conversation

althonos
Copy link
Member

@althonos althonos commented Dec 21, 2021

Type of changes

  • Bug fix

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

The current implementation of WrapFS.move and WrapFS.movedir was always going through the fs.move functions. For move, this was just causing one extra call (WrapFS.move -> fs.move.move_file -> WrapFS.delegate_fs().move). But for movedir, this was never the case (fs.move.move_dir is always copying/removing the files, and never tries to call movedir because of recursivity issues, this should be fixed too at some point):

home_fs = open_fs("~")
pics_fs = home_fs.opendir("Pictures")
pics_fs.movedir("My kid", "My kids")  # this was never using `home_fs.movedir`, always copying files

@coveralls
Copy link

coveralls commented Dec 21, 2021

Coverage Status

Coverage decreased (-0.006%) to 95.258% when pulling df36726 on fix-wrapfs-move into a6ea045 on master.

@althonos althonos merged commit 63719b1 into master Feb 7, 2022
@althonos althonos added the bug label Feb 7, 2022
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.

None yet

2 participants