-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
zipapp disregards filter when checking if target overwrites source #132933
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
Comments
Can you bisect the commit or give a reference for prosperity? TiA. |
cc @pfmoore |
No when the fix is merged there'll be a reference to this issue and if the one who merges your PR decides so, they may also include the bad commit.
Yes, because it was backported to 3.13. |
This comment has been minimized.
This comment has been minimized.
I've added a review to the PR. If the comments I've made there can be addressed, I'm willing to consider adding this. But please be clear - this does not mean that putting the target in the source directory is safe, or recommended. To repeat what I said on the PR for reference, the real answer here is that you shouldn't be putting the generated zipapp in the directory containing the source files for the zipapp. That's not good practice, and it's perfectly possible to end up with a corrupt zipapp by doing so. If you insist on doing this, then rather than adding a filter, you can delete the zipapp before recreating it. That will avoid the "false positive" error, as well as being safer in general. Remember - the source directory is what your app will be built from. You should be carefully controlling the content of that directory. Putting arbitrary build files in there, even if you add filters to strip them out, is not safe practice for maintaining your source code. |
Bug report
Bug description:
A check was recently added (#130509) to ensure that the target of a zipapp.create_archive() call does not overwrite any of its source files. However, this check does not consider the filter parameter of create_archive and this results in false positives.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: