summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35502: Fix reference leaks in ElementTree.TreeBuilder. (GH-11170)Serhiy Storchaka2018-12-181-0/+5
|
* bpo-35454: Fix miscellaneous minor issues in error handling. (#11077)Serhiy Storchaka2018-12-111-1/+4
| | | | | | * bpo-35454: Fix miscellaneous minor issues in error handling. * Fix a null pointer dereference.
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-1/+1
| | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
* Fix error handling bugs in _elementtree.c. (GH-10060)Zackery Spytz2018-10-231-11/+11
| | | | References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised.
* bpo-35013: Add more type checks for children of Element. (GH-9944)Serhiy Storchaka2018-10-191-25/+44
| | | | | | It is now guarantied that children of xml.etree.ElementTree.Element are Elements (at least in C implementation). Previously methods __setitem__(), __setstate__() and __deepcopy__() could be used for adding non-Element children.
* bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924)Serhiy Storchaka2018-10-181-31/+64
| | | | | C implementation of xml.etree.ElementTree.Element.__setstate__() leaked references to children when called for already initialized element.
* bpo-34941: Fix searching Element subclasses. (GH-9766)Serhiy Storchaka2018-10-141-12/+13
| | | | Methods find(), findtext() and findall() of xml.etree.ElementTree.Element were not able to find chldren which are instances of Element subclasses.
* bpo-34739: Get rid of tp_getattro in xml.etree.ElementTree.XMLParser. (GH-9420)Serhiy Storchaka2018-10-041-24/+19
| | | Use tp_members and tp_getset instead.
* bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)Christian Heimes2018-09-181-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
* bpo-34218: Fix a leak in _elementtree.c introduced in GH-6769. (GH-8460)Serhiy Storchaka2018-07-251-0/+1
|
* bpo-29209: Remove old-deprecated features in ElementTree. (GH-6769)Serhiy Storchaka2018-07-241-73/+14
| | | | | Also make getchildren() and getiterator() emitting a DeprecationWarning instead of PendingDeprecationWarning.
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-151-1/+1
| | | | arguments. (#4746)
* bpo-31728: Prevent crashes in _elementtree due to unsafe cleanup of ↵Oren Milman2017-10-101-34/+28
| | | | Element.text and Element.tail (#3924)
* bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash (#3641)Victor Stinner2017-09-181-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>
* bpo-31455: Fix an assertion failure in ElementTree.XMLParser(). (#3545)scoder2017-09-141-2/+33
| | | | | | * 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.
* bpo-31428: Prevent raising a SystemError in case the memo arg of ↵Oren Milman2017-09-121-4/+5
| | | | ElementTree.Element.__deepcopy__() isn't a dictionary. (#3512)
* bpo-31095: fix potential crash during GC (GH-2974)INADA Naoki2017-08-241-1/+3
|
* bpo-30892: Fix _elementtree module initialization (#2647)Victor Stinner2017-07-101-0/+5
| | | | Handle getattr(copy, 'deepcopy') error in _elementtree module initialization.
* bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)Serhiy Storchaka2017-07-031-1/+1
| | | | | the bare METH_FASTCALL be used for functions with positional-only parameters.
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)Serhiy Storchaka2017-04-191-2/+2
| | | | | | raised an error. Replace them with using concrete types API that never fails if appropriate.
* Expand the PySlice_GetIndicesEx macro. (#1023)Serhiy Storchaka2017-04-081-6/+6
|
* bpo-29204: Emit warnings for already deprecated ElementTree features. (#773)Serhiy Storchaka2017-03-301-2/+37
| | | | | | | | Element.getiterator() and the html parameter of XMLParser() were deprecated only in the documentation (since Python 3.2 and 3.4 correspondintly). Now using them emits a deprecation warning. * Don’t need check_warnings any more.
* bpo-27863: Fixed multiple crashes in ElementTree. (#765)Serhiy Storchaka2017-03-301-48/+52
|
* Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-171-1/+1
| | | | | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using "boring" positional arguments. Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain consistent with the clinic code.
* Merge from 3.6.Serhiy Storchaka2016-12-211-0/+2
|\
| * Merge from 3.5.Serhiy Storchaka2016-12-211-0/+2
| |\
| | * Issue #28871: Fixed a crash when deallocate deep ElementTree.Serhiy Storchaka2016-12-211-0/+2
| | |
* | | Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of ↵Serhiy Storchaka2016-12-161-1/+1
| | | | | | | | | | | | dict.
* | | Use PyObject_CallFunctionObjArgs()Victor Stinner2016-12-091-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Replace PyObject_CallFunction() with PyObject_CallFunctionObjArgs() when the format string was only made of "O" formats, PyObject* arguments. PyObject_CallFunctionObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string.
* | | Use _PyObject_CallMethodIdObjArgs() in _elementtreeVictor Stinner2016-12-091-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string was only made of "O" formats, PyObject* arguments. _PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string.
* | | Issue #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-051-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace _PyObject_CallArg1(func, arg) with PyObject_CallFunctionObjArgs(func, arg, NULL) Using the _PyObject_CallArg1() macro increases the usage of the C stack, which was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this issue.
* | | Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-1/+1
| | | | | | | | | | | | | | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* | | Replace PyObject_CallFunction() with fastcallVictor Stinner2016-12-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace PyObject_CallFunction(func, "O", arg) and PyObject_CallFunction(func, "O", arg, NULL) with _PyObject_CallArg1(func, arg) Replace PyObject_CallFunction(func, NULL) with _PyObject_CallNoArg(func) _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack.
* | | Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
* | | Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-201-1/+1
|/ / | | | | | | UTF-8 represenatation of Unicode objects.
* | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-3/+3
|\ \ | |/ | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-3/+3
| | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | Fix xml.etree.ElementTree.Element.getiterator()Victor Stinner2016-09-291-1/+1
| | | | | | | | | | Issue #28314: Fix function declaration (C flags) for the getiterator() method of xml.etree.ElementTree.Element.
* | replace PY_SIZE_MAX with SIZE_MAXBenjamin Peterson2016-09-071-1/+1
| |
* | replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson2016-09-061-4/+4
| |
* | Avoid calling functions with an empty string as format stringVictor Stinner2016-09-061-1/+1
| | | | | | | | Directly pass NULL rather than an empty string.
* | Rename _PyObject_FastCall() to _PyObject_FastCallDict()Victor Stinner2016-08-221-1/+1
| | | | | | | | | | | | | | | | Issue #27809: * Rename _PyObject_FastCall() function to _PyObject_FastCallDict() * Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1() macros calling _PyObject_FastCallDict()
* | _elementtree: deepcopy() now uses fast callVictor Stinner2016-08-191-8/+4
| | | | | | | | Issue #27128.
* | Issue #25455: Fixed a crash in repr of ElementTree.Element with recursive tag.Serhiy Storchaka2016-06-121-3/+16
|\ \ | |/
| * Issue #25455: Fixed a crash in repr of ElementTree.Element with recursive tag.Serhiy Storchaka2016-06-121-3/+16
| |
* | Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-101-4/+4
|\ \ | |/ | | | | in places where Py_DECREF was used.
| * Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-101-4/+4
| | | | | | | | in places where Py_DECREF was used.
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-13/+13
|\ \ | |/
| * Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-11/+11
| |
* | Issue #20440: Cleaning up the code by using Py_SETREF.Serhiy Storchaka2016-01-051-3/+1
| |