bpo-13611: C14N 2.0 implementation for ElementTree#12966
Merged
scoder merged 26 commits intopython:masterfrom May 1, 2019
Merged
bpo-13611: C14N 2.0 implementation for ElementTree#12966scoder merged 26 commits intopython:masterfrom
scoder merged 26 commits intopython:masterfrom
Conversation
…r in "_elementtree" to make it use the same factories as the ElementTree module, and to make it explicit when the comments/PIs are inserted into the tree and when they are not (which is the default).
…MLParser target in ElementTree.
…ck receives the calls in the right order.
Missing features: - prefix renaming in XPath expressions (tag and attribute text is supported) - preservation of original prefixes given redundant namespace declarations
a3ed3f9 to
c00dd43
Compare
…, especially since we don't really know the correct encoding (some files use Latin-1, others UTF-8).
… and/or no attributes.
…se (and use what lxml uses for C14N 1.0).
…its result as text string if not output file is provided.
…y file-like objects.
tirkarthi
requested changes
May 1, 2019
Contributor
|
I tested this PR locally, and there seems to be reference leaks. The following is the output of |
Contributor
Author
|
@ZackerySpytz, thanks for testing (and providing the command :) ) |
scoder
commented
May 1, 2019
| Py_VISIT(self->handle_start); | ||
| Py_VISIT(self->handle_start_ns); | ||
| Py_VISIT(self->handle_end_ns); | ||
| Py_VISIT(self->handle_doctype); |
Contributor
Author
There was a problem hiding this comment.
This was actually missing before. Since it refers to an arbitrary user provided (callable) object, it must be visible to the GC.
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.
This is based on GH-12883 and GH-12885.
The only changes that are relevant to this PR are in
ElementTree.pyand the C14N test case intest_xml_etree.py, plus the added C14N 2.0 test files.Documentation missing, pending a review of the overall API.
https://bugs.python.org/issue13611