Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132322: Ensure shutil functions return str when using pathlib#132820

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
rpxchoudhury wants to merge3 commits intopython:main
base:main
Choose a base branch
Loading
fromrpxchoudhury:132322-shutil-pathlib-return

Conversation

rpxchoudhury
Copy link

@rpxchoudhuryrpxchoudhury commentedApr 23, 2025
edited by bedevere-appbot
Loading

Fixes issue#132322 by normalizing return types in shutil.copy, copy2, copyfile, copytree, and move using os.fspath(), so that they consistently return str even when pathlib.Path is passed.

All relevant tests pass locally

Fixes issuepython#132322 by normalizing return types in shutil.copy, copy2, copyfile, copytree, and move using os.fspath(), so that they consistently return str even when pathlib.Path is passed.All relevant tests pass locally
@python-cla-bot
Copy link

python-cla-botbot commentedApr 23, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

Copy link
Member

@ZeroIntensityZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Would you mind adding a test?

@@ -0,0 +1 @@
shutil.copy, copy2, copyfile, copytree, and move now consistently return str even when passed pathlib.Path arguments.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Use Sphinx refs:

Suggested change
shutil.copy,copy2,copyfile,copytree, and move now consistently return str even when passed pathlib.Path arguments.
:func:`shutil.copy`,:func:`~shutil.copy2`,:func:`~shutil.copyfile`,:func:`~shutil.copytree`, and:func:`~shutil.move` now consistently return:class:`str` even when passed:class:`pathlib.Path` arguments.

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

@ZeroIntensityZeroIntensityZeroIntensity left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@rpxchoudhury@ZeroIntensity

[8]ページ先頭

©2009-2025 Movatter.jp