Python: Add support for extraction filters - #14918
Merged
Merged
Conversation
Adds support for extraction filters as defined in https://peps.python.org/pep-0706/ and implemented in Python 3.12. By my reading, setting the filter to `'data'` or `'tar'` is probably safe, whereas `'fully_trusted'` or the default (which is the same as `None`) is not. For now, I have just added this modelling to the tarslip query. We could also share it with the modelling of `shutil.unpack_archive` (which has also gained a `filter` argument), but it was unclear to me where we should put this modelling in that case. Perhaps the best solution would be to merge the experimental `py/tarslip-extended` query into the existing query (in which case the current location is perhaps not too bad).
RasmusWL
requested changes
Nov 28, 2023
RasmusWL
left a comment
Member
There was a problem hiding this comment.
I agree with your reading that we should treat both 'data' and 'tar' as safe, at least for the tar-slip query 👍
I think we can rewrite the core bits of the code to really use the expressive powers of API graphs 😊
This will probably break the tests in the short run. I'll fix the remaining issues in a follow-up commit. Co-authored-by: Rasmus Wriedt Larsen <rasmuswl@github.com>
RasmusWL
approved these changes
Nov 29, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds support for extraction filters as defined in https://peps.python.org/pep-0706/ and implemented in Python 3.12.
By my reading, setting the filter to
'data'or'tar'is probably safe, whereas'fully_trusted'or the default (which is the same asNone) is not.For now, I have just added this modelling to the tarslip query. We could also share it with the modelling of
shutil.unpack_archive(which has also gained afilterargument), but it was unclear to me where we should put this modelling in that case. Perhaps the best solution would be to merge the experimentalpy/tarslip-extendedquery into the existing query (in which case the current location is perhaps not too bad).