summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] Fix error handling bugs in _elementtree.c. (GH-10060) (GH-10080)Zackery Spytz2018-10-261-28/+37
| | | | | | | Don't leak a reference if PyDict_Update() fails, check the PyList_New() call in treebuilder_new(), and properly handle failures in xmlparser(). (cherry picked from commit 9f3ed3e213b30059087d059a7d1d3b2527fa8654)
* [2.7] bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146) (GH-9394)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. (cherry picked from commit cb5778f00ce48631c7140f33ba242496aaf7102b) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue34623
* [2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)Serhiy Storchaka2018-07-311-2/+2
|
* bpo-31544: Fix a reference leak to 'self' after the previous target error ↵scoder2018-03-311-6/+21
| | | | | | handling fixes. (GH-6318) This change generally splits the xmlparser creation code into an unsafe part with "rollback" error handling and a safe "object initialisation done" part with normal decref cleanup.
* bpo-31544: Avoid calling "PyObject_GetAttrString()" (and potentially ↵scoder2018-03-241-2/+33
| | | | executing user code) with a live exception set. (GH-3992)
* [2.7] bpo-31728: Prevent crashes in _elementtree due to unsafe cleanup of ↵Oren Milman2017-10-111-20/+21
| | | | Element.text and Element.tail (GH-3924) (#3950)
* consistently use Py_TYPE, Py_REFCNT, and correct initializer macros (#3563)Benjamin Peterson2017-09-141-6/+6
| | | This no-op change makes 2.7 more consistent with 3.x to ease comparison and backports.
* bpo-30615: Fix the leak reference in Modules/_elementtree.c (#2129)Stéphane Wirtel2017-06-121-1/+3
|
* bpo-30365: Backport warnings and fix bugs in ElementTree. (#1581)Serhiy Storchaka2017-05-171-7/+36
| | | | | | | | | | | | | | | | | | Running Python with the -3 option now emits deprecation warnings for getchildren() and getiterator() methods of the Element class in the xml.etree.cElementTree module and when pass the html argument to xml.etree.ElementTree.XMLParser(). Fixed a deprecation warning about the doctype() method of the xml.etree.ElementTree.XMLParser class. Now it is emitted only when define the doctype() method in the subclass of XMLParser. Fixed a bug in the test_bug_200708_close test method. An EchoTarget instance was incorrectly passed to XMLParser() as the html argument and silently ignored. Tests no longer failed when use the -m option for running only selected test methods. Checking warnings now is more specific, warnings are expected only when use deprecated features.
* bpo-30074: Fix compile warnings of _PySlice_Unpack and convert missed (#1154)Serhiy Storchaka2017-04-151-2/+2
| | | | PySlice_GetIndicesEx in _ctypes.c.
* bpo-27867: Expand the PySlice_GetIndicesEx macro. (#1023) (#1046)Serhiy Storchaka2017-04-081-6/+6
| | | | (cherry picked from commit b879fe8)
* bpo-27863: Fixed multiple crashes in ElementTree. (#765) (#903) (#963)Serhiy Storchaka2017-04-021-41/+51
| | | | | (cherry picked from commit 576def096ec7b64814e038f03290031f172886c3) (cherry picked from commit a6b4e1902250d6f28ca6d083ce1c8d7e9b91974b)
* bpo-29876: fix DECREF for NULL value in subelement() (GH-760)Xiang Zhang2017-03-221-1/+2
|
* bpo-29873: fix INCREF for possible NULL value in element_getattr() (GH-757)Xiang Zhang2017-03-221-1/+1
|
* Backed out changeset 78bf34b6a713Serhiy Storchaka2016-12-281-19/+4
|
* Issue #28871: Fixed a crash when deallocate deep ElementTree.Serhiy Storchaka2016-12-211-4/+19
| | | | Fixed running MiscTests in test_xml_etree_c.
* when you enter repr, you must leave, too (#25455)Benjamin Peterson2016-12-031-0/+1
|
* Issue #25455: Fixed a crash in repr of cElementTree.Element with recursive tag.Serhiy Storchaka2016-06-121-9/+19
|
* Correct “an” → “a” with “Unicode”, “user”, “UTF”, etcMartin Panter2016-04-151-1/+1
| | | | This affects documentation and code comments.
* 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-9/+9
|
* Issue #20440: More use of Py_SETREF.Serhiy Storchaka2015-12-271-19/+12
| | | | | This patch is manually crafted and contains changes that couldn't be handled automatically.
* Issue #24103: Fixed possible use after free in ElementTree.iterparse().Serhiy Storchaka2015-12-241-13/+7
|
* Fixed possible leaks in ElementTree parser.Serhiy Storchaka2015-12-091-2/+8
|
* Issue25814: Propagate all errors from custom XML parser handlersSerhiy Storchaka2015-12-061-73/+45
| | | | in ElementTree.iterparse().
* Fixed compilation error introduced in 745fd5550bc0.Serhiy Storchaka2015-11-261-1/+1
|
* Issue #19687: Fixed possible integer overflows in ElementTree.Serhiy Storchaka2015-11-251-6/+23
| | | | Based on patch by Christian Heimes.
* Issue #19687: Fixed memory leak on failed Element slice assignment.Serhiy Storchaka2015-11-221-10/+6
|
* Issue #24091: Fixed various crashes in corner cases in cElementTree.Serhiy Storchaka2015-05-181-20/+45
|
* Issue #20437: Fixed 43 potential bugs when deleting objects references.Serhiy Storchaka2014-02-091-4/+4
|
* Fix indentation from previous commitEli Bendersky2013-11-281-2/+2
|
* Issue #19815: Fix segfault when parsing empty namespace declaration.Eli Bendersky2013-11-281-1/+4
| | | | Based on patches by Christian Heimes and Vajrasky Kok
* Issue #13612: Fix a buffer overflow in case of a multi-byte encoding.Eli Bendersky2013-08-041-0/+2
| | | | This is a belated backport of f7b47fb30169; Patch by Serhiy Storchaka.
* Issue #2892: preserve iterparse events in case of SyntaxErrorFlorent Xicluna2011-11-011-15/+23
|
* Closes #7334: close source files on ElementTree.parse and iterparse (partial ↵Florent Xicluna2011-10-291-11/+21
| | | | backport of issue #10093 from 3.2).
* Backported PyCapsule from 3.1, and converted most uses ofLarry Hastings2010-03-251-1/+1
| | | | CObject to PyCapsule.
* Fix repr of tree Element on windows.Florent Xicluna2010-03-111-7/+8
|
* Issue #6472: The xml.etree package is updated to ElementTree 1.3. The ↵Florent Xicluna2010-03-111-253/+506
| | | | cElementTree module is updated too.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-26/+26
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-26/+26
|
* Coverity issue CID #182Christian Heimes2008-01-181-0/+10
| | | | size_error: Allocating 1 bytes to pointer "children", which needs at least 4 bytes
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-6/+6
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-6/+6
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* SF#1534630Fredrik Lundh2006-08-161-1/+5
| | | | ignore data that arrives before the opening start tag
* Klocwork made another run and found a bunch more problems.Neal Norwitz2006-08-121-1/+1
| | | | | | | This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
* Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).Trent Mick2006-06-191-2/+2
|
* Fix some Py_ssize_t issuesNeal Norwitz2006-06-121-5/+6
|
* "_self" is a said to be a reserved word in Watcom C 10.6. I'mFredrik Lundh2006-06-031-2/+2
| | | | | not sure that's really standard compliant behaviour, but I guess we have to fix that anyway...
* Fix problems found by Coverity.Neal Norwitz2006-05-101-1/+3
| | | | | | | | | | | | | longobject.c: also fix an ssize_t problem <a> could have been NULL, so hoist the size calc to not use <a>. _ssl.c: under fail: self is DECREF'd, but it would have been NULL. _elementtree.c: delete self if there was an error. _csv.c: I'm not sure if lineterminator could have been anything other than a string. However, other string method calls are checked, so check this one too.
* merged with cElementTree development trunk (1.0.6 snapshot):Fredrik Lundh2006-03-121-32/+60
| | | | | | Fixed a number of potential null-pointer-reference-under-pressure glitches, based on input from the Coverity analysis tool and Simo Salminen.