summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-9566: Fix compiler warnings in pyexpat.c (GH-10654)Victor Stinner2018-11-221-2/+4
| | | | | | | | | | Explicit cast a pointer difference (intptr_t) to int to fix two warnings on 64-bit Windows: Modules\pyexpat.c(1181): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data Modules\pyexpat.c(1192): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data
* bpo-34741: Get rid of tp_getattro and tp_setattro in pyexpat.xmlparser. ↵Serhiy Storchaka2018-10-191-327/+268
| | | | | | (GH-9422) Use tp_members and tp_getset instead.
* Fix several reference counting bugs in pyexpat.c. (GH-9955)Zackery Spytz2018-10-191-4/+8
|
* 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-28411: Support other mappings in PyInterpreterState.modules. (#3593)Eric Snow2017-09-151-8/+2
| | | | | The concrete PyDict_* API is used to interact with PyInterpreterState.modules in a number of places. This isn't compatible with all dict subclasses, nor with other Mapping implementations. This patch switches the concrete API usage to the corresponding abstract API calls. We also add a PyImport_GetModule() function (and some other helpers) to reduce a bunch of code duplication.
* bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565)Eric Snow2017-09-141-2/+8
| | | PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
* bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)Eric Snow2017-09-041-8/+2
| | | sys.modules is the one true source.
* bpo-29591: Upgrade Modules/expat to libexpat 2.2 (#2164)Victor Stinner2017-06-141-4/+2
| | | | | | | | | | | | | | | | | | | | | * bpo-29591: Upgrade Modules/expat to libexpat 2.2 * bpo-29591: Restore Python changes on expat * bpo-29591: Remove expat config of unsupported platforms Remove the configuration (Modules/expat/*config.h) of unsupported platforms: * Amiga * MacOS Classic on PPC32 * Open Watcom * bpo-29591: Remove useless XML_HAS_SET_HASH_SALT The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became useless since our local expat copy was upgrade to expat 2.1 (it's now expat 2.2.0).
* bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485)Serhiy Storchaka2017-03-121-2/+2
|
* bpo-29768: Fixed compile-time check for expat version. (#574)Serhiy Storchaka2017-03-091-1/+1
|
* Removed redundant Argument Clinic directives.Serhiy Storchaka2017-02-041-5/+0
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-8/+4
| | | | possible. Patch is writen with Coccinelle.
* Issue #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-051-1/+1
| | | | | | | | | | | 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.
* Replace PyObject_CallFunction() with fastcallVictor Stinner2016-12-011-1/+1
| | | | | | | | | | | | | | | | | 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.
* Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-22/+21
|\ | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-22/+21
| | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | Add error checking to PyInit_pyexpactChristian Heimes2016-09-081-1/+11
| | | | | | | | | | | | | | The module initializer of the pyexpat module failed to check the return value of PySys_GetObject() for NULL. CID 982779
* | - Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-4/+4
|\ \ | |/ | | | | generated by Argument Clinic. Patch by Petr Viktorin.
| * Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-4/+4
| | | | | | | | generated by Argument Clinic. Patch by Petr Viktorin.
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-1/+1
|\ \ | |/
* | Issue #20440: Cleaning up the code by using Py_SETREF and Py_CLEAR.Serhiy Storchaka2015-12-271-13/+4
| | | | | | | | | | 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.
* | Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-251-3/+3
| | | | | | | | private functions.
* | Issue #25558: Use compile-time asserts.Serhiy Storchaka2015-11-071-1/+2
|/
* Raise more correct exception on overflow in setting buffer_size attribute ofSerhiy Storchaka2015-09-071-6/+7
|\ | | | | | | expat parser.
| * Raise more correct exception on overflow in setting buffer_size attribute ofSerhiy Storchaka2015-09-071-6/+7
| | | | | | | | expat parser.
* | Issue #25019: Fixed a crash caused by setting non-string key of expat parser.Serhiy Storchaka2015-09-071-1/+6
|\ \ | |/ | | | | | | Added additional tests for expat parser attributes. Based on patch by John Leitch.
| * Issue #25019: Fixed a crash caused by setting non-string key of expat parser.Serhiy Storchaka2015-09-071-1/+6
| | | | | | | | | | Added additional tests for expat parser attributes. Based on patch by John Leitch.
* | Specify default values of semantic booleans in Argument Clinic generated ↵Serhiy Storchaka2015-05-301-4/+4
| | | | | | | | signatures as booleans.
* | Issue #24001: Argument Clinic converters now use accept={type}Larry Hastings2015-05-041-5/+5
| | | | | | | | instead of types={'type'} to specify the types the converter accepts.
* | Issue #23944: Argument Clinic now wraps long impl prototypes at column 78.Larry Hastings2015-04-141-6/+10
| |
* | Issue #23501: Argumen Clinic now generates code into separate files by default.Serhiy Storchaka2015-04-031-293/+14
| |
* | Issue #23685: Fix usage of PyMODINIT_FUNC in _json, _scproxy, nis, pyexpatVictor Stinner2015-03-171-10/+0
| | | | | | | | | | | | | | | | _codecs_cn, _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr and _codecs_tw modules. pyexpat.c doesn't need to redeclare PyMODINIT_FUNC, it's already declared in Include/pyport.h.
* | Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integerSerhiy Storchaka2015-02-161-2/+2
|\ \ | |/ | | | | overflows. Added few missed PyErr_NoMemory().
| * Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integerSerhiy Storchaka2015-02-161-2/+2
| | | | | | | | overflows. Added few missed PyErr_NoMemory().
* | Issue #22462: Fix pyexpat's creation of a dummy frame to make it appear in ↵Antoine Pitrou2014-10-081-113/+7
|\ \ | |/ | | | | | | | | exception tracebacks. Initial patch by Mark Shannon.
| * Issue #22462: Fix pyexpat's creation of a dummy frame to make it appear in ↵Antoine Pitrou2014-10-081-113/+7
| | | | | | | | | | | | exception tracebacks. Initial patch by Mark Shannon.
* | Removed redundant casts to `char *`.Serhiy Storchaka2014-09-281-5/+4
| | | | | | | | Corresponding functions now accept `const char *` (issue #1772673).
* | Issue #20152: Port pyexpat to Argument Clinic.Brett Cannon2014-08-221-154/+471
|/ | | | | Could not emit an external file as pyexpat has a conditionally built method which Clinic won't hide otherwise.
* Issue #6676: Ensure a meaningful exception is raised when attemptingNed Deily2014-03-271-1/+1
| | | | | | to parse more than one XML document per pyexpat xmlparser instance. (Original patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with suggested wording by David Gutteridge)
* Issue #20437: Fixed 22 potential bugs when deleting objects references.Serhiy Storchaka2014-02-091-2/+1
|\
| * Issue #20437: Fixed 21 potential bugs when deleting objects references.Serhiy Storchaka2014-02-091-2/+1
| |
* | silence an overflow warning. slen is smaller than 1MBChristian Heimes2013-11-211-1/+2
| |
* | ssue #19183: Implement PEP 456 'secure and interchangeable hash algorithm'.Christian Heimes2013-11-201-1/+1
| | | | | | | | Python now uses SipHash24 on all major platforms.
* | Check return value of PyEval_GetGlobals() for NULLChristian Heimes2013-07-201-2/+7
|\ \ | |/ | | | | CID 486814
| * Check return value of PyEval_GetGlobals() for NULLChristian Heimes2013-07-201-2/+7
| | | | | | | | CID 486814
* | Check return value of flush_character_buffer()Christian Heimes2013-07-201-1/+3
|\ \ | |/ | | | | CID 486663
| * Check return value of flush_character_buffer()Christian Heimes2013-07-201-1/+3
| | | | | | | | CID 486663
* | Issue #18501, #18408: Fix expat handlers in pyexpat, don't call PythonVictor Stinner2013-07-181-0/+15
| | | | | | | | functions if a Python exception was raised
* | Issue #18408: Fix pyexpat.ParserCreate()Victor Stinner2013-07-151-9/+10
| | | | | | | | | | Check if XML_ParserCreate_MM() failed (ex: MemoryError) before using self->itself.
* | Issue #18227: pyexpat now uses a static XML_Memory_Handling_Suite. ↵Christian Heimes2013-07-071-6/+6
| | | | | | | | cElementTree uses the same approach since at least Python 2.6