Larry Hastings
dbfdc380df
Issue #24001 : Argument Clinic converters now use accept={type}
instead of types={'type'} to specify the types the converter accepts.
11 years ago
Serhiy Storchaka
cb98556373
Issue #20159 . Converted the _elementtree module to Argument Clinic.
11 years ago
Serhiy Storchaka
26861b0b29
Issue #23450 : Fixed possible integer overflows.
11 years ago
Victor Stinner
706768c687
Issue #22156 : Fix some "comparison between signed and unsigned integers"
compiler warnings in the Modules/ subdirectory.
12 years ago
Eli Bendersky
4b79518f83
Fix indentation from previous commit
12 years ago
Eli Bendersky
5dd40e555b
Issue #19815 : Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
12 years ago
Eli Bendersky
163d7f02a1
Cosmetic fixes
12 years ago
Victor Stinner
59799a8399
Don't use deprecated function PyUnicode_GET_SIZE()
Replace it with PyUnicode_GET_LENGTH() or PyUnicode_AsUnicodeAndSize()
12 years ago
Antoine Pitrou
09fcb72048
Issue #19356 : Avoid using a C variabled named "_self", it's a reserved word in some C compilers.
12 years ago
doko@ubuntu.com
0648bf795c
- followup for issue #18997 , make _clear_joined_ptr static.
12 years ago
Eli Bendersky
dd3661e782
Issue #18997 : fix ElementTree crash with using pickle and __getstate__.
Based on report and initial patch from Germán M. Bravo
13 years ago
Eli Bendersky
6eb50b1f5b
Use consistent style for else if / else
13 years ago
Eli Bendersky
532d03e547
Issue #15651 : PEP 3121 refactoring for _elementtree
Patch by Antoine Pitrou (based on Robin Schreiber's original patch)
13 years ago
Christian Heimes
7ed4294d7f
Add missing check of PyDict_Update()'s return value in _elementtree.c
CID 719637
13 years ago
Ronald Oussoren
138d080a28
#18480 : Add missing PyType_Ready call to _elementtree extension
13 years ago
Victor Stinner
3fd8cbd5e4
Issue #18408 : Fix _elementtree.c, don't call Python function from an expat
handler if a Python exception is set
13 years ago
Victor Stinner
d917dcbe5e
Issue #18408 : Fix constructors of _elementtree.c
* Use Py_DECREF() instead of PyObject_GC_Del() to release correctly all
resources
* Raise MemoryError on memory allocation failure
13 years ago
Victor Stinner
81aac734e1
Issue #18408 : Fix create_extra() of _elementtree.c, raise MemoryError on memory
allocation failure
13 years ago
Victor Stinner
71c8b7ec04
Issue #18408 : Different fixes in _elementtree.c to handle correctly MemoryError
* create_new_element() initializes all attributes before handling errors,
to fix a crash in the destructor
* create_new_element() calls PyObject_GC_Del() on error, instead of
PyObject_Del(), because the object was created by PyObject_GC_New()
* subelement() now handles create_new_element() failure
* element_getattro() now handles element_get_text() failure
* makeuniversal() now handles PyBytes_FromStringAndSize() failure
13 years ago
Victor Stinner
4d46343340
Cleanup _elementtree.c
13 years ago
Victor Stinner
5f0af23f5e
Issue #18408 : _elementtree.c now handles create_extra() failure
13 years ago
Eli Bendersky
6dc32b34dd
Issue #13612 : handle unknown encodings without a buffer overflow.
This affects pyexpat and _elementtree. PyExpat_CAPI now exposes a new
function - DefaultUnknownEncodingHandler.
Based on a patch by Serhiy Storchaka.
13 years ago
Serhiy Storchaka
66d53fa9ad
Issue #16986 : ElementTree now correctly parses a string input not only when
an internal XML encoding is UTF-8 or US-ASCII.
13 years ago
Eli Bendersky
6a55dc3b4a
Issue #17989 : fix typo in error message
13 years ago
Eli Bendersky
08231a9c6a
Issue #17901 : fix TreeBuilder construction for an explicit element_factory=None
Based on report and patch by Aaron Oakley.
13 years ago
Eli Bendersky
ef9683b73f
Issue #17989 : element_setattro returned incorrect error value.
This caused an exception to be raised later than expected.
13 years ago
Eli Bendersky
a369923cab
Get rid of ugly code duplication for ElementTree.parse when the accelerator
is imported. Instead, ElementTree.parse can look for a special internal method
defined by the accelerator.
13 years ago
Eli Bendersky
3a4fbd8241
_elementtree.XMLParser._setevents should support any sequence, not just tuples
Also clean up some code around this
13 years ago
Eli Bendersky
45f3d2fff0
Revert c9674421d78e, leaving an additional comment
13 years ago
Eli Bendersky
1859fe80c4
Simplify the code of get_attrib_from_keywords somewhat.
13 years ago
Eli Bendersky
d4cb4b7451
Issue #17736 : fix misleading comment in _elementtree.c
Patch by Jonas Wagner
13 years ago
Eli Bendersky
ddcc6798f6
Remove useless #define and #ifdefs
13 years ago
Eli Bendersky
bf05df2396
Make license notices more consistent and remove old changelog.
Also remove unused macro.
13 years ago
Eli Bendersky
25771b3749
Issue #16922 : fixed findtext() to return empty Unicode string instead of empty bytes object when there's no text.
Patch by Serhiy Storchaka.
13 years ago
Eli Bendersky
b09b167419
Issue #16922 : fixed findtext() to return empty Unicode string instead of empty bytes object when there's no text.
Patch by Serhiy Storchaka.
13 years ago
Eli Bendersky
4583990143
Clean trailing whitespace in _elementtree.c
13 years ago
Eli Bendersky
799e3edaf7
Issue #16076 : check for return value of PyTuple_New for args (following
Coverity report) and cleanup code.
13 years ago
Eli Bendersky
b8f6dc855c
Issue #16076 : fix refleak in pickling of Element.
Thanks to Ezio Melotti and Daniel Shahaf for the patch.
13 years ago
Eli Bendersky
e6174ca85e
Issue #16913 : Fix Element.itertext()'s handling of text with XML entities.
Patch by Serhiy Storchaka
13 years ago
Eli Bendersky
698bdb2a6c
Issue #16076 : make _elementtree.Element pickle-able in a way that is compatible
with the Python version of the class.
Patch by Daniel Shahaf.
13 years ago
Eli Bendersky
a873690d2c
The get() and iter() are now able to accept keyword arguments.
In conformance with the documentation and the Python version.
Patch by Franck Michea.
13 years ago
Antoine Pitrou
ee329318db
Issue #16089 : Allow ElementTree.TreeBuilder to work again with a non-Element element_factory (fixes a regression in SimpleTAL).
13 years ago
Antoine Pitrou
c194884983
Sanitize and modernize some of the _elementtree code (see issue #16089 ).
13 years ago
Antoine Pitrou
ca8aa4acf6
Issue #15144 : Fix possible integer overflow when handling pointers as integer values, by using Py_uintptr_t instead of size_t.
Patch by Serhiy Storchaka.
13 years ago
Eli Bendersky
ef391ac982
Raise ImportError if pyexpat's version is incompatible
14 years ago
Eli Bendersky
66099b0cdc
ISsue #14988 : restore Python 2's behavior of raising ImportError when unable to load pyexpat, instead of a SystemError/RuntimeError
14 years ago
Martin v. Löwis
bce166681c
Issue #14055 : Add __sizeof__ support to _elementtree.
14 years ago
Eli Bendersky
113da64259
Fix windows compilation problems caused by previous commit.
14 years ago
Eli Bendersky
64d11e60f2
Replace the iter/itertext methods of Element in _elementtree with true C implementations, instead of the bootstrapped Python code. In addition to being cleaner (removing the last remains of the bootstrapping code in _elementtree), this gives a 10x performance boost for iter() on large documents.
Also reorganized the tests a bit to be more robust.
14 years ago
Eli Bendersky
c68e1368b5
Fix unterminated keyword array passed to PyArg_ParseTupleAndKeywords
14 years ago