Skip to content

Conversation

@oz123
Copy link
Contributor

@oz123oz123 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

@oz123oz123force-pushed the bpo-46317-pathlib-move branch from b885731 to b3f4752CompareJanuary 17, 2022 19:48
@oz123oz123 changed the title bpo-46317: Add Pathlib.move that can handle rename across FSbpo-46317: Add pathlib.Path.move that can handle rename across FSJan 17, 2022
@oz123oz123force-pushed the bpo-46317-pathlib-move branch from b3f4752 to 673f1c9CompareJanuary 17, 2022 19:50
Copy link
Contributor

@barneygalebarneygale 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 :-)

@oz123oz123force-pushed the bpo-46317-pathlib-move branch 2 times, most recently from 9d35c9a to b20e32fCompareJanuary 24, 2022 22:35
@oz123oz123force-pushed the bpo-46317-pathlib-move branch from b20e32f to 84157e1CompareFebruary 4, 2022 13:09
@oz123oz123force-pushed the bpo-46317-pathlib-move branch from bb1a964 to 29dfb12CompareFebruary 5, 2022 23: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.
@oz123oz123force-pushed the bpo-46317-pathlib-move branch from 29dfb12 to edce418CompareFebruary 6, 2022 20:22
Copy link
Contributor

@MaxwellDupreMaxwellDupre 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.

@oz123oz123mannequin mentioned this pull request Jun 21, 2022
@barneygalebarneygale changed the title bpo-46317: Add pathlib.Path.move that can handle rename across FSGH-73991: Add pathlib.Path.move that can handle rename across FSApr 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.

@oz123
Copy link
ContributorAuthor

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

Sign up for freeto 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

@oz123@barneygale@MaxwellDupre@brettcannon@the-knights-who-say-ni@ezio-melotti@bedevere-bot