You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
while experimenting with the FS lib, I’ve encountered an unexpected ResourceNotFound error. The error is raised if the param preserve_time=True and we try to move a file on the same OS or in-memory filesystem.
This block represents a reproduceable example for a MemoryFS:
I have modified the test case test_move_file_same_fs and found similar errors for OS- and Temp-filesystems. For my understanding, the current implementation wants to copy the file’s metadata, after moving it or renaming its path. Therefore, the copy_modified_time function encounters a missing resource under these conditions:
moving a file on the same filesystem
preserve_time=True
AND either
copy_modified_time is called after moving the file, see memoryfs.py
or FS.move of base.py is used and the filesystem supports renaming, see base.py
Is this a limitation of my system (Win11 x64)?
I could not find similar issues or information in the docs.
If this is a not yet supported edge case, I would suggest that we read the file’s meta data first, then move it and update the meta info afterwards.
Any review and comments are welcome!
Regards
The text was updated successfully, but these errors were encountered:
Yup, it sounds like you've found a bug, and it sounds like you've already identified the fix. Good work.
Do you want to submit a suitable PR with the fix and updated tests?
Hi,
while experimenting with the FS lib, I’ve encountered an unexpected
ResourceNotFound
error. The error is raised if the parampreserve_time=True
and we try to move a file on the same OS or in-memory filesystem.This block represents a reproduceable example for a MemoryFS:
The raised error message:
I have modified the test case
test_move_file_same_fs
and found similar errors for OS- and Temp-filesystems. For my understanding, the current implementation wants to copy the file’s metadata, after moving it or renaming its path. Therefore, thecopy_modified_time
function encounters a missing resource under these conditions:AND either
copy_modified_time
is called after moving the file, see memoryfs.pyor FS.move of base.py is used and the filesystem supports renaming, see base.py
Is this a limitation of my system (Win11 x64)?
I could not find similar issues or information in the docs.
If this is a not yet supported edge case, I would suggest that we read the file’s meta data first, then move it and update the meta info afterwards.
Any review and comments are welcome!
Regards
The text was updated successfully, but these errors were encountered: