gh-156568: Make zipapp archives executable with PathLike targets - #156569
gh-156568: Make zipapp archives executable with PathLike targets#156569eoan-ermine wants to merge 1 commit into
Conversation
|
@pfmoore fyi |
| @@ -0,0 +1,2 @@ | |||
| :func:`zipapp.create_archive` now correctly sets the executable bit on the | |||
| target archive when the target is a path-like object. | |||
There was a problem hiding this comment.
| target archive when the target is a path-like object. | |
| target archive when copying a zipapp where the target is a path-like object. |
| source.mkdir() | ||
| (source / '__main__.py').touch() | ||
| target = self.tmpdir / 'source.pyz' | ||
| zipapp.create_archive(source, target, interpreter='python') |
There was a problem hiding this comment.
Needs a comment explaining why we are creating the zipapp twice. Something like:
Copying an archive uses a different code path than creating one from scratch. Ensure that the executable bit is set even if the target is a path-like object.
Maybe also add a reference to the bug report.
In theory we should have checks for both the str and the os.PathLike cases, but that feels like overkill.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Fix
zipapp.create_archive()not setting the executable bit for PathLike targets.zipapp.create_archive#156568