- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.3k
GH-73991: Add pathlib.Path.move that can handle rename across FS #30650
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
Conversation
b885731    to
    b3f4752      
    Compare
  
    b3f4752    to
    673f1c9      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer metadata=True over copy_function=shutil.copy2, and would like to request a third opinion :-)
9d35c9a    to
    b20e32f      
    Compare
  
    b20e32f    to
    84157e1      
    Compare
  
    bb1a964    to
    29dfb12      
    Compare
  
    With this change, ``pathlib.Path.move`` adds the ability to handle renaming across file system and also preserve metadata when renaming, since ``shutil.move`` using ``shutil.copy2`` is used under the hood.
29dfb12    to
    edce418      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran 462 tests in 3.520s
OK (skipped=137)
Added test passed. Looks ok.
| I'm going to close this PR because I've added a (different) implementation of  | 
| Thanks for letting me know. I'm happy that the issue is finally resolved. | 
With this change,
Pathlib.moveadds the abilityto handle renaming across file system and also preserve metadata
when renaming, since
shutil.moveusingshutil.copy2is usedunder the hood.
https://bugs.python.org/issue46317
https://bugs.python.org/issue46317