pyfilesystem2 icon indicating copy to clipboard operation
pyfilesystem2 copied to clipboard

Make all self-move operations raise `IllegalDestination` error

Open althonos opened this issue 3 years ago • 1 comments

Type of changes

  • Bug fix
  • New feature
  • Tests

Checklist

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

Description

As discussed with @lurch in #547, this PR makes all self-move operations raise IllegalDestination instead of being silent. In fs.move.move_file, DestinationExists takes priority if overwrite is False.

althonos avatar Aug 19 '22 13:08 althonos

Coverage Status

Coverage decreased (-0.004%) to 94.811% when pulling ef508c28df0fd718170c3b9b1597d743eac952b8 on illegal-self-move into 59f6e4d51a1983ca28d0b667bd1d6b3284ab5c56 on master.

coveralls avatar Aug 19 '22 13:08 coveralls