GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-73991: Add pathlib.Path.move that can handle rename across FS by oz123 · Pull Request #30650 · python/cpython

Conversation

@oz123

@oz123 oz123 commented Jan 17, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

  • Issue: Support moving across filesystems in pathlib.Path, as shutil.move() does #73991

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jan 17, 2022
@bedevere-bot bedevere-bot added the awaiting review label Jan 17, 2022
@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
barneygale
barneygale reviewed Jan 19, 2022
View reviewed changes

@barneygale barneygale left a comment

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/pathlib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_pathlib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@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
barneygale
barneygale reviewed Feb 5, 2022
View reviewed changes
Comment thread Lib/pathlib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@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
@oz123
bpo-46317: Add pathlib.Path.move that can handle renaming across FS
8be5cdc
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
Fix grammar: replace wrong an with a
edce418
@oz123
oz123 force-pushed the bpo-46317-pathlib-move branch from 29dfb12 to edce418 Compare February 6, 2022 20:22
MaxwellDupre
MaxwellDupre approved these changes Apr 13, 2022
View reviewed changes

@MaxwellDupre MaxwellDupre left a comment

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Apr 13, 2022
@brettcannon brettcannon added the topic-pathlib label Jun 21, 2022
@oz123 oz123 mannequin mentioned this pull request Jun 21, 2022
Pathlib.rename isn't robust #90475
Closed
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
@ric-evans ric-evans mentioned this pull request Oct 5, 2022
Pathlib rename() Workaround Observation-Management-Service/ewms-pilot#6
Merged
@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
@bedevere-bot bedevere-bot mentioned this pull request Apr 14, 2023
Support moving across filesystems in pathlib.Path, as shutil.move() does #73991
Closed
@barneygale

barneygale commented Aug 26, 2024

Copy link
Copy Markdown
Contributor

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

oz123 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@barneygale barneygale closed this Aug 26, 2024
@oz123

oz123 commented Aug 26, 2024

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@barneygale barneygale barneygale left review comments
+1 more reviewer
@MaxwellDupre MaxwellDupre MaxwellDupre approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review topic-pathlib

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@oz123 @barneygale @MaxwellDupre @brettcannon @the-knights-who-say-ni @ezio-melotti @bedevere-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.