-
-
Notifications
You must be signed in to change notification settings - Fork 34k
bpo-41643: always support pathlib in shutil.make_archive #21962
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
graingert
wants to merge
3
commits into
python:main
from
graingert:always-support-pathlib-in-make-archive
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1030,8 +1030,10 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, | |
| uses the current owner and group. | ||
| """ | ||
| sys.audit("shutil.make_archive", base_name, format, root_dir, base_dir) | ||
| base_name = os.fsdecode(base_name) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn’t fsdecode about bytes-str decoding, and fspath for pathlike-to-OS-native conversion? |
||
| save_cwd = os.getcwd() | ||
| if root_dir is not None: | ||
| root_dir = os.fsdecode(root_dir) | ||
| if logger is not None: | ||
| logger.debug("changing into '%s'", root_dir) | ||
| base_name = os.path.abspath(base_name) | ||
|
|
@@ -1040,6 +1042,7 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, | |
|
|
||
| if base_dir is None: | ||
| base_dir = os.curdir | ||
| base_dir = os.fsdecode(base_dir) | ||
|
|
||
| kwargs = {'dry_run': dry_run, 'logger': logger} | ||
|
|
||
|
|
||
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Library/2020-08-26-11-56-35.bpo-41643.1ESh-R.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| always support pathlib in shutil.make_archive |
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.
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.
not sure what the rules are re-auditing, would it be better to do:
before the audit call or after?
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.
What do you mean by
???Uh oh!
There was an error while loading. Please reload this page.
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.
https://peps.python.org/pep-0505/ syntax, but it's not used should be something like
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.
meaning
is not NoneI assume!