summaryrefslogtreecommitdiff
path: root/Modules/_elementtree.c
AgeCommit message (Collapse)AuthorLines
2018-12-11[3.6] bpo-35454: Fix miscellaneous minor issues in error handling. ↵Serhiy Storchaka-1/+4
(GH-11077) (GH-11106) (cherry picked from commit 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6)
2018-10-23Fix error handling bugs in _elementtree.c. (GH-10060)Miss Islington (bot)-11/+11
References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised. (cherry picked from commit 9f3ed3e213b30059087d059a7d1d3b2527fa8654) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-18bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924)Miss Islington (bot)-31/+64
C implementation of xml.etree.ElementTree.Element.__setstate__() leaked references to children when called for already initialized element. (cherry picked from commit 6f906b3d727d6b341abd5ad9c0652bbcbd5eb024) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-14[3.6] bpo-34941: Fix searching Element subclasses. (GH-9766) (GH-9868)Serhiy Storchaka-12/+13
Methods find(), findtext() and findall() of xml.etree.ElementTree.Element were not able to find chldren which are instances of Element subclasses. (cherry picked from commit b11c5667f99c4f0018e3394c4d07c519d835671a)
2018-09-18bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)Miss Islington (bot)-0/+5
The C accelerated _elementtree module now initializes hash randomization salt from _Py_HashSecret instead of libexpat's default CPRNG. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue34623 (cherry picked from commit cb5778f00ce48631c7140f33ba242496aaf7102b) Co-authored-by: Christian Heimes <christian@python.org>
2017-10-11[3.6] bpo-31728: Prevent crashes in _elementtree due to unsafe cleanup of ↵Miss Islington (bot)-34/+28
Element.text and Element.tail (GH-3924) (#3945) (cherry picked from commit 39ecb9c71b6e55d8a61a710d0144231bd88f9ada)
2017-09-18[3.6] bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash (GH-3641) (#3645)Miss Islington (bot)-1/+5
* bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash xml.etree: xmlparser_gc_clear() now sets self.parser to NULL to prevent a crash in xmlparser_dealloc() if xmlparser_gc_clear() was called previously by the garbage collector, because the parser was part of a reference cycle. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit e727d41ffcd91b21ce82026ec8c8381d34a16209)
2017-09-15[3.6] bpo-31455: Fix an assertion failure in ElementTree.XMLParser(). ↵Miss Islington (bot)-2/+33
(GH-3545) (#3585) * Avoid calling "PyObject_GetAttrString()" (and potentially executing user code) with a live exception set. * Ignore only AttributeError on attribute lookups in ElementTree.XMLParser() and propagate all other exceptions. (cherry picked from commit c8d8e15bfc24abeeaaf3d8be9073276b0c011cdf)
2017-09-04bpo-31095: fix potential crash during GC (GH-3195)INADA Naoki-1/+3
(cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
2017-07-10bpo-30892: Fix _elementtree module initialization (#2647) (#2649)Victor Stinner-0/+5
Handle getattr(copy, 'deepcopy') error in _elementtree module initialization. (cherry picked from commit b136f11f3a51f9282ae992bac68f170ca5563b55)
2017-04-08Expand the PySlice_GetIndicesEx macro. (#1023) (#1044)Serhiy Storchaka-6/+6
(cherry picked from commit b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8)
2017-03-30bpo-27863: Fixed multiple crashes in ElementTree. (#765) (#903)Serhiy Storchaka-48/+52
(cherry picked from commit 576def096ec7b64814e038f03290031f172886c3)
2016-12-21Merge from 3.5.Serhiy Storchaka-0/+2
2016-12-21Issue #28871: Fixed a crash when deallocate deep ElementTree.Serhiy Storchaka-0/+2
2016-11-16Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka-3/+3
_PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
2016-11-16Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka-3/+3
_PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
2016-09-29Fix xml.etree.ElementTree.Element.getiterator()Victor Stinner-1/+1
Issue #28314: Fix function declaration (C flags) for the getiterator() method of xml.etree.ElementTree.Element.
2016-09-07replace PY_SIZE_MAX with SIZE_MAXBenjamin Peterson-1/+1
2016-09-06replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson-4/+4
2016-09-05Avoid calling functions with an empty string as format stringVictor Stinner-1/+1
Directly pass NULL rather than an empty string.
2016-08-22Rename _PyObject_FastCall() to _PyObject_FastCallDict()Victor Stinner-1/+1
Issue #27809: * Rename _PyObject_FastCall() function to _PyObject_FastCallDict() * Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1() macros calling _PyObject_FastCallDict()
2016-08-20_elementtree: deepcopy() now uses fast callVictor Stinner-8/+4
Issue #27128.
2016-06-12Issue #25455: Fixed a crash in repr of ElementTree.Element with recursive tag.Serhiy Storchaka-3/+16
2016-06-12Issue #25455: Fixed a crash in repr of ElementTree.Element with recursive tag.Serhiy Storchaka-3/+16
2016-04-10Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka-4/+4
in places where Py_DECREF was used.
2016-04-10Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka-4/+4
in places where Py_DECREF was used.
2016-04-06Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka-13/+13
2016-04-06Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka-11/+11
2016-01-05Issue #20440: Cleaning up the code by using Py_SETREF.Serhiy Storchaka-3/+1
2015-12-27Issue #20440: Cleaning up the code by using Py_SETREF and Py_CLEAR.Serhiy Storchaka-5/+1
Old code is correct, but with Py_SETREF and Py_CLEAR it can be cleaner. This patch doesn't fix bugs and hence there is no need to backport it.
2015-12-27Issue #20440: More use of Py_SETREF.Serhiy Storchaka-22/+12
This patch is manually crafted and contains changes that couldn't be handled automatically.
2015-12-27Issue #20440: More use of Py_SETREF.Serhiy Storchaka-24/+14
This patch is manually crafted and contains changes that couldn't be handled automatically.
2015-12-24Issue #24103: Fixed possible use after free in ElementTree.XMLPullParser.Serhiy Storchaka-19/+13
2015-12-24Issue #24103: Fixed possible use after free in ElementTree.XMLPullParser.Serhiy Storchaka-19/+13
2015-12-21Issue #25869: Optimized deepcopying ElementTree; it is now 20 times faster.Serhiy Storchaka-24/+54
2015-12-21Issue #25873: Optimized iterating ElementTree.Serhiy Storchaka-158/+101
Iterating elements Element.iter() is now 40% faster, iterating text Element.itertext() is now up to 2.5 times faster.
2015-12-21Issue #25902: Fixed various refcount issues in ElementTree iteration.Serhiy Storchaka-32/+58
2015-12-21Issue #25902: Fixed various refcount issues in ElementTree iteration.Serhiy Storchaka-32/+58
2015-12-19Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka-1/+1
This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
2015-12-19Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka-1/+1
This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
2015-12-10Issue #25638: Optimized ElementTree parsing; it is now 10% faster.Serhiy Storchaka-9/+20
2015-12-09Fixed possible leaks in ElementTree parser.Serhiy Storchaka-2/+8
2015-12-09Fixed possible leaks in ElementTree parser.Serhiy Storchaka-2/+8
2015-12-09Fixed possible leak in ElementTree.Element.iter().Serhiy Storchaka-11/+11
2015-12-09Fixed possible leak in ElementTree.Element.iter().Serhiy Storchaka-11/+11
2015-12-07Issue #25638: Optimized ElementTree.iterparse(); it is now 2x faster.Serhiy Storchaka-16/+19
ElementTree.XMLParser._setevents now accepts any objects with the append method, not just a list.
2015-12-06Issue25814: Propagate all errors from custom XML parser handlersSerhiy Storchaka-88/+39
in ElementTree.iterparse().
2015-12-06Issue25814: Propagate all errors from custom XML parser handlersSerhiy Storchaka-88/+39
in ElementTree.iterparse().
2015-12-06Issue25814: Propagate all errors from custom XML parser handlersSerhiy Storchaka-88/+39
in ElementTree.iterparse().
2015-11-25Issue #19687: Fixed possible integer overflows in ElementTree.Serhiy Storchaka-10/+34
Based on patch by Christian Heimes.