GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-94844: Add pathlib support to shutil archive management by arhadthedev · Pull Request #94846 · python/cpython Conversation
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| if isinstance(file, os.PathLike): | |
| file = os.fspath(file) |
so make_archive can safely cast its path param to a str as well (including implicit conversion in f-strings).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@barneygale Thank you, addressed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Could you call |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Fixed; I quiet misunderstood first. Currently I put the conversion after |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Could you remove the changes to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| class TestPathlibPathArchives(_ArchiveTests, unittest.TestCase): | ||
|
|
||
| def _make_archive_with_path(self, path, /, *args, **kwargs): | ||
| return make_archive(pathlib.Path(path), *args, **kwargs) | ||
|
|
||
| _make_archive = _make_archive_with_path |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No need to add a class. A single test will suffice.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reverted; I agree that after the conversion moved into make_archive frontend, there is no need to explicitly test _make_* backends.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if not dry_run: | ||
| os.chdir(root_dir) | ||
|
|
||
| base_name = os.fspath(base_name) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please do it only if root_dir is not None, and only if support_root_dir is true (because os.path.abspath() already does the work).
It is an undocumented behavior and we do not want to introduce a new official feature in a bugfix release.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thank you, amended.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,2 @@ | |||
| :meth:`shutil.make_archive` now accepts any :class:`os.PathLike`. Patch by | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It was undocumented behavior, and we do not yet guarantee it in future versions, so no NEWS entry is needed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done; could you add skip-news label please?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @arhadthedev for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @arhadthedev for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-95054 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…honGH-94846) Co-authored-by: Barney Gale <[email protected]> (cherry picked from commit ed44415) Co-authored-by: Oleg Iarygin <[email protected]>
…honGH-94846) Co-authored-by: Barney Gale <[email protected]> (cherry picked from commit ed44415) Co-authored-by: Oleg Iarygin <[email protected]>
|
GH-95055 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@serhiy-storchaka Thanks for merging. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Barney Gale <[email protected]> (cherry picked from commit ed44415) Co-authored-by: Oleg Iarygin <[email protected]>
Co-authored-by: Barney Gale <[email protected]> (cherry picked from commit ed44415) Co-authored-by: Oleg Iarygin <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.