Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

oz123
Copy link
Contributor

@oz123 oz123 commented Jan 17, 2022

With this change, Pathlib.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.

https://bugs.python.org/issue46317

https://bugs.python.org/issue46317

@oz123 oz123 force-pushed the bpo-46317-pathlib-move branch from b885731 to b3f4752 Compare January 17, 2022 19:48
@oz123 oz123 changed the title bpo-46317: Add Pathlib.move that can handle rename across FS bpo-46317: Add pathlib.Path.move that can handle rename across FS Jan 17, 2022
@oz123 oz123 force-pushed the bpo-46317-pathlib-move branch from b3f4752 to 673f1c9 Compare January 17, 2022 19:50
Copy link
Contributor

@barneygale barneygale left a 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 :-)

@oz123 oz123 force-pushed the bpo-46317-pathlib-move branch 2 times, most recently from 9d35c9a to b20e32f Compare January 24, 2022 22:35
@oz123 oz123 force-pushed the bpo-46317-pathlib-move branch from b20e32f to 84157e1 Compare February 4, 2022 13:09
@oz123 oz123 force-pushed the bpo-46317-pathlib-move branch from bb1a964 to 29dfb12 Compare February 5, 2022 23:21
oz123 added 2 commits February 6, 2022 21:21
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.
@oz123 oz123 force-pushed the bpo-46317-pathlib-move branch from 29dfb12 to edce418 Compare February 6, 2022 20:22
Copy link
Contributor

@MaxwellDupre MaxwellDupre left a 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.

@oz123 oz123 mannequin mentioned this pull request Jun 21, 2022
@barneygale barneygale changed the title bpo-46317: Add pathlib.Path.move that can handle rename across FS GH-73991: Add pathlib.Path.move that can handle rename across FS Apr 14, 2023
@barneygale
Copy link
Contributor

I'm going to close this PR because I've added a (different) implementation of move() in GH-122073. Thank you.

@barneygale barneygale closed this Aug 26, 2024
@oz123
Copy link
Contributor Author

oz123 commented Aug 26, 2024

Thanks for letting me know. I'm happy that the issue is finally resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants