summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45329: Fix freed memory access in pyexpat.c (GH-28649)TAGAMI Yukihiro2021-10-021-1/+1
|
* bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)Erlend Egeberg Aasland2021-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make functools types immutable * Multibyte codec types are now immutable * pyexpat.xmlparser is now immutable * array.arrayiterator is now immutable * _thread types are now immutable * _csv types are now immutable * _queue.SimpleQueue is now immutable * mmap.mmap is now immutable * unicodedata.UCD is now immutable * sqlite3 types are now immutable * _lsprof.Profiler is now immutable * _overlapped.Overlapped is now immutable * _operator types are now immutable * winapi__overlapped.Overlapped is now immutable * _lzma types are now immutable * _bz2 types are now immutable * _dbm.dbm and _gdbm.gdbm are now immutable
* bpo-42972: Fully support GC for pyexpat, unicodedata, and dbm/gdbm heap ↵Erlend Egeberg Aasland2021-05-271-21/+18
| | | | | | | types (GH-26376) * bpo-42972: pyexpat * bpo-42972: unicodedata * bpo-42972: dbm/gdbm
* bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)Erlend Egeberg Aasland2021-04-301-1/+2
| | | | | | | | | | | | | | | | | | | | | Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to the following types: * _dbm.dbm * _gdbm.gdbm * _multibytecodec.MultibyteCodec * _sre..SRE_Scanner * _thread._localdummy * _thread.lock * _winapi.Overlapped * array.arrayiterator * functools.KeyWrapper * functools._lru_list_elem * pyexpat.xmlparser * re.Match * re.Pattern * unicodedata.UCD * zlib.Compress * zlib.Decompress
* bpo-1635741: Port pyexpat to multi-phase init (PEP 489) (GH-22222)Mohamed Koubaa2021-01-041-95/+127
|
* bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)Hai Shi2021-01-031-27/+40
|
* bpo-1635741: Fix PyInit_pyexpat() error handling (GH-22489)Mohamed Koubaa2020-11-041-189/+299
| | | | Split PyInit_pyexpat() into sub-functions and fix reference leaks on error paths.
* bpo-42152: Use PyDict_Contains and PyDict_SetDefault if appropriate. (GH-22986)Serhiy Storchaka2020-10-261-9/+1
| | | | | | | If PyDict_GetItemWithError is only used to check whether the key is in dict, it is better to use PyDict_Contains instead. And if it is used in combination with PyDict_SetItem, PyDict_SetDefault can replace the combination.
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-1/+1
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode ↵Serhiy Storchaka2020-04-111-1/+1
| | | | data. (GH-19345)
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-38392: PyObject_GC_Track() validates object in debug mode (GH-16615)Victor Stinner2019-10-071-2/+3
| | | | | | | | In debug mode, PyObject_GC_Track() now calls tp_traverse() of the object type to ensure that the object is valid: test that objects visited by tp_traverse() are valid. Fix pyexpat.c: only track the parser in the GC once the parser is fully initialized.
* bpo-37206: Unrepresentable default values no longer represented as None. ↵Serhiy Storchaka2019-09-141-3/+3
| | | | | | | (GH-13933) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all.
* bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)Serhiy Storchaka2019-09-011-1/+3
| | | Only AttributeError should be silenced.
* bpo-29548: no longer use PyEval_Call* functions (GH-14683)Jeroen Demeyer2019-07-111-1/+1
|
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-041-1/+1
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-11/+19
|
* 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.