Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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
base:main
Are you sure you want to change the base?
Conversation
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-botbot commentedApr 23, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 the |
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.
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. |
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.
Use Sphinx refs:
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. |
Uh oh!
There was an error while loading.Please reload this page.
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