Repository navigation
Fix preserving modification times on same-filesystem moves - #611
Open
Hugohong258 wants to merge 1 commit into
Open
Hugohong258 wants to merge 1 commit into
Hugohong258 wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of changes
Checklist
Description
Fixes #558. Moving a file within the same filesystem with
preserve_time=Truecan raiseResourceNotFoundafter the original path has already been renamed. MemoryFS has the same problem when moving a directory.A successful filesystem rename retains the file's modification time, and MemoryFS moves the existing entry with its timestamps intact. Avoid reading the old path in those cases; the copy-based fallback still copies the timestamp before removing the source. Regression tests cover direct and helper moves, destination replacement, and a MemoryFS directory with a child.
Thanks to @mj0nez for reporting the bug and the earlier investigation in #559.
Validation
python -m pytest tests/test_move.py -q(26 passed; 10 existing deprecation warnings).--checkand the project flake8 configuration passed on the three changed Python files.unittest.TestCase.assertEqualsalias; the full test matrix was not run.