[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
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

bpo-13611: C14N 2.0 implementation for ElementTree #12966

Merged
merged 26 commits into from May 1, 2019

Conversation

Copy link
Contributor

scoder commented Apr 26, 2019

This is based on GH-12883 and GH-12885.
The only changes that are relevant to this PR are in ElementTree.py and the C14N test case in test_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

scoder added 5 commits Apr 20, 2019
…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).
Missing features:
- prefix renaming in XPath expressions (tag and attribute text is supported)
- preservation of original prefixes given redundant namespace declarations
Lib/xml/etree/ElementTree.py Outdated Show resolved Hide resolved
Copy link
Contributor

ZackerySpytz commented May 1, 2019

I tested this PR locally, and there seems to be reference leaks. The following is the output of ./python -m test -R 3:3 test_xml_etree_c:

Run tests sequentially
0:00:00 load avg: 1.09 [1/1] test_xml_etree_c
beginning 6 repetitions
123456
......
test_xml_etree_c leaked [208, 208, 208] references, sum=624
test_xml_etree_c leaked [51, 51, 51] memory blocks, sum=153
test_xml_etree_c failed

== Tests result: FAILURE ==

1 test failed:
    test_xml_etree_c

Total duration: 2 sec 801 ms
Tests result: FAILURE

Copy link
Contributor Author

scoder commented May 1, 2019

@ZackerySpytz, thanks for testing (and providing the command :) )
I'll look into it.

@@ -3783,6 +3787,8 @@ xmlparser_gc_traverse(XMLParserObject *self, visitproc visit, void *arg)
Py_VISIT(self->handle_data);
Py_VISIT(self->handle_start);
Py_VISIT(self->handle_start_ns);
Py_VISIT(self->handle_end_ns);
Py_VISIT(self->handle_doctype);
Copy link
Contributor Author

scoder May 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was actually missing before. Since it refers to an arbitrary user provided (callable) object, it must be visible to the GC.

scoder merged commit e1d5dd6 into python:master May 1, 2019
scoder deleted the bpo-13611_et_c14n2 branch May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants