python


Log

Author Commit Date CI Message
Nick Wellnhofer 347c2b2e 2025-06-02T23:26:19 valid: Deprecate a few functions and `xmllint --insert`
Nick Wellnhofer fca0860d 2025-05-19T21:17:39 tree: Deprecate public struct members related to DTDs Let's deprecate these members for now. If these are really used, they can be undeprecated later.
Nick Wellnhofer 2f3655c9 2025-05-20T19:40:06 parser: Pop PEs that start markup declarations explicitly We currently only handle "Validity constraint: Proper Declaration/PE Nesting", but we must detect "Well-formedness constraint: PE Between Declarations" separately: > The replacement text of a parameter entity reference in a DeclSep must > match the production extSubsetDecl. PEs in DeclSeps are PEs that start with a full markup declaration (or another PE). These are handled in xmParse{Internal|External}Subset. We set a flag on these PEs and don't close them implicitly in xmlSkipBlankCharsPE. This will make unterminated declarations in such PEs cause a parser error. The PEs are closed explicitly in xmParse{Internal|External}Subset, the only location where they are allowed to end.
Dag-Erling Smørgrav 3ab040c2 2025-05-24T01:12:15 Fix unidiomatic use of vsnprintf(). * Don't terminate an already-terminated buffer. * Consistently use 1024-byte buffers. * While here, consistently use ap for a va_list.
Dag-Erling Smørgrav 8ea253b8 2025-05-24T01:00:25 Remove bogus casts. * Casting a string literal to `char *` and then immediately passing or assigning the result to a `const char *` makes no sense. * There is no need to cast `int` to `Py_ssize_t` as they have the same sign and the latter is at least as wide as the former.
Nick Wellnhofer 210f5a37 2025-05-16T21:18:16 chvalid: Mark functions as deprecated
Nick Wellnhofer 6f4b4527 2025-05-15T23:43:32 parser: Stop using ctxt->linenumbers I think this was used to avoid setting the `line` member before it was added (20+ years ago).
Nick Wellnhofer d834437b 2025-05-15T19:12:25 python: Add deprecation warning
Nick Wellnhofer 258d8706 2025-05-15T17:49:49 codegen: Consolidate tools for code generation Move tools, source files and output tables into codegen directory. Rename some files. Adjust tools to match modified files. Remove generation date and source files from output. Distribute all tools and sources.
Nick Wellnhofer a40f36e7 2025-05-14T04:04:28 include: Stop using *Ptr typedefs in public headers
Nick Wellnhofer 46f05ea4 2025-05-09T00:21:47 html: Rework meta charset handling Don't use encoding from meta tags when serializing. Only use the value in `doc->encoding`, matching the XML serializer. This is the actual encoding used when parsing. Stop modifying the input document by setting meta tags before serializing. Meta tags are now injected during serialization. Add full support for <meta charset=""> which is also used when adding meta tags. Align with HTML5 and implement the "algorithm for extracting a character encoding from a meta element". Only modify the encoding substring in Content-Type meta tags. Only switch encoding once when parsing. Fix htmlSaveFileFormat with a NULL encoding not to declare a misleading UTF-8 charset. Fixes #909.
Pavel Kopylov 4ed71574 2025-05-09T11:58:01 python: fix use-after-free in functions xmlPythonFileReadRaw(), xmlPythonFileRead() with python2. Fixes #910.
Nick Wellnhofer a449c5fd 2025-05-03T01:31:09 catalog: Deprecate some functions
Nick Wellnhofer 05d0f592 2025-05-06T19:47:00 python: Skip __xml thread-local accessors So we can remove conditional directives for Doxygen.
Nick Wellnhofer 18c446a5 2025-05-02T14:41:29 python: Remove libxml2-python-api.xml Should have been removed with commit ed850ec1.
Nick Wellnhofer 1eca6e34 2025-04-30T00:54:00 parser: Deprecate xmlClearParserCtxt
Nick Wellnhofer 321aa356 2025-04-28T21:42:08 python: Make generator.py use Doxygen XML
Nick Wellnhofer ed850ec1 2025-04-28T20:04:19 python: Merge libxml2-python-api.xml into generator.py
Nick Wellnhofer 9419f6de 2025-04-29T01:58:32 meson: Install libxml2.py Apparently, nobody has ever tried to use the Python bindings built with Meson.
Nick Wellnhofer 6896f478 2025-04-18T17:22:36 Revert "valid: Remove duplicate error messages when streaming" This reverts commit cd220b93d8ffffd2fb7cac0ec792bebb7e082521. This commit broke the xmstarlet tests.
Maks Verver 4d24aa22 2025-04-05T13:15:03 python: Add a test to reproduce bug #889
Maks Verver 8d415b89 2025-04-08T13:13:55 [CVE-2025-32414] python: Read at most len/4 characters. Fixes #889 by reserving space in the buffer for UTF-8 encoding of text.
Dan Yeaw 38cc2b53 2025-04-11T16:57:23 python: Stop generating libxml2class.txt
Dan Yeaw e2647854 2025-04-11T16:53:41 python: Fix file variable not defined during exception
Dan Yeaw ffef921b 2025-03-31T22:18:14 python: Concat generated files in generator.py
Nick Wellnhofer 97ffa77d 2025-04-10T17:36:58 encoding: Deprecate non-thread-safe functions
Nick Wellnhofer 2ecc08f6 2025-04-09T21:11:47 html: Deprecate more functions
Nick Wellnhofer 4135ceea 2025-03-14T03:19:21 meson: Run Python tests
Nick Wellnhofer 69657224 2025-03-04T20:32:02 globals: Remove unused globals - xmlBufferAllocScheme - xmlDefaultBufferSize - xmlParserDebugEntities
Nick Wellnhofer 92d7b0cd 2025-03-04T20:18:11 xpath: Rename valuePush and valuePop
Nick Wellnhofer 03be993c 2025-03-04T18:42:35 Use memcpy to avoid pointer cast warnings
Nick Wellnhofer 85bd58ef 2025-03-04T16:07:40 globals: Remove functions related to global state handling - xmlGetGlobalState - xmlInitializeGlobalState - xmlGetThreadId - xmlIsMainThread
Nick Wellnhofer 03a8d5f9 2025-03-04T16:00:08 unicode: Make Unicode functions private
Nick Wellnhofer 361f7bff 2025-03-04T13:02:36 parser: Make nodePush, nodePop, namePush, namePop private
Nick Wellnhofer e50d314a 2025-02-25T23:07:19 build: Add separate configuration option for RELAX NG Support for RELAX NG used to be enabled together with XML Schema support (--with-schemas). Now there's a separate option and a new feature macro LIBXML_RELAXNG_ENABLED.
Nick Wellnhofer 6fc26076 2025-02-22T20:31:45 regexp: Hide debugging code behind DEBUG_REGEXP xmlRegexpPrint is now a deprecated no-op.
Jan Alexander Steffens (heftig) 064a0211 2025-02-20T13:52:40 meson: Fix Python module build
Jan Alexander Steffens (heftig) c2e2d762 2025-02-20T13:51:26 python: Pass destination dir to generator.py Simplify usage across build systems.
Nick Wellnhofer cd220b93 2024-12-27T14:55:43 valid: Remove duplicate error messages when streaming
Nick Wellnhofer 7ca75b32 2024-12-07T15:07:46 python: Declare init func with PyMODINIT_FUNC
Nick Wellnhofer 0dc26910 2024-11-20T21:04:19 parser: Deprecate more internal functions
Nick Wellnhofer e2ad249c 2024-11-17T19:48:44 parser: Deprecate more internal symbols - xmlParseExternalSubset - xmlPushInput - xmlPopInput - xmlCopyCharMultiByte - xmlCreateEntityParserCtxt - xmlStringComment
Yegor Yefremov 51394929 2024-10-15T11:11:38 python/tests: fix typos Typos were found with codespell.
Satadru Pramanik c7b27866 2024-10-12T11:55:50 Avoid Python 'licence' distribution option is deprecated; use 'license' error
Nick Wellnhofer c34d0ae9 2024-09-12T23:50:20 html: Deprecate htmlIsBooleanAttr
Nick Wellnhofer 6040785a 2024-09-12T23:12:01 html: Deprecate AutoClose API
Nick Wellnhofer e179f3ec 2024-09-11T17:29:59 html: Stop reporting syntax errors It doesn't make much sense to keep the old syntax error handling which doesn't conform to HTML5. Handling HTML5 parser errors is rather involved and not essential for parsers.
Nick Wellnhofer c46b89e2 2024-09-13T21:06:36 xpath: Deprecate xmlXPathEvalExpr Also check the argument instead of crashing if there's no context.
Nick Wellnhofer 40abebbc 2024-08-29T01:02:33 python: Fix SAX driver with character streams This apparently broke with Python 3.5 which introduced character streams. Fixes #790.
Nick Wellnhofer eb66d03e 2024-07-07T23:15:54 io: Deprecate a few functions
Nick Wellnhofer 69f12d6d 2024-07-13T00:17:18 encoding: Deprecate xmlByteConsumed This was only used by Chromium/WebKit to detect whether xmlParseContent really succeeded. It's a horrible, overcomplicated hack. See 8c5848bd and #767.
Nick Wellnhofer ec088109 2024-07-04T15:15:17 parser: Upgrade XML_IO_NETWORK_ATTEMPT to error Fixes XML::LibXML test suite.
Nick Wellnhofer 30ef7755 2024-07-02T04:02:16 parser: Don't use deprecated xmlCopyChar
Nick Wellnhofer cc0cc2d3 2024-06-26T04:32:49 parser: Add more parser context accessors
Nick Wellnhofer c5750fc6 2024-06-26T04:28:36 python: Switch to xmlCtxtSetErrorHandler
Nick Wellnhofer 3ff8a2c4 2024-06-26T01:08:48 parser: Deprecate xmlIsLetter
Nick Wellnhofer c2ccbc0f 2024-06-21T22:45:15 meson: Implement option dependencies This also removes the FreeBSD hack.
Rosen Penev 5d542fef 2024-06-16T20:02:45 libxml: define ATTRIBUTE_UNUSED for clang Silences warnings under Clang on Windows. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Nick Wellnhofer 1112699c 2024-06-17T02:42:18 legacy: Remove most legacy functions from public headers Also remove warning messages.
Nick Wellnhofer 2608baaf 2024-06-14T19:42:40 parser: Make failure to load main document a warning Revert the change that made failures to load the main document an error. This fixes the --path option of xmllint and xsltproc. Should fix #733.
Nick Wellnhofer b34dc1e4 2024-06-10T23:20:22 tree: Deprecate xmlBuffer members
Nick Wellnhofer 712a31ab 2024-06-10T23:06:13 parser: Deprecate most public struct members This will probably cause many warnings in downstream code abusing libxml2 internals, but we can always undeprecate some members later.
Nick Wellnhofer 669bd349 2024-06-12T18:20:01 xpointer: Remove support for XPointer locations The latest spec for what it essentially an XPath extension seems to be this working draft from 2002: https://www.w3.org/TR/xptr-xpointer/ The xpointer() scheme is listed as "being reviewed" in the XPointer registry since at least 2006. libxml2 seems to be the only modern software that tries to implement this spec, but the code has many bugs and quality issues. If you configure --with-legacy, old symbols are retained for ABI compatibility.
Nick Wellnhofer dba1ed85 2024-06-12T18:19:55 ftp: Remove FTP support Remove the built-in FTP client. If you configure --with-legacy, old symbols are retained for ABI compatibility.
Nick Wellnhofer 1b1e8b3c 2024-06-10T16:39:57 io: Stop invoking generic error handler for IO errors
Rosen Penev f2270863 2024-06-06T13:42:03 meson: convert boolean options to feature option Simpler. Seems like they're only disabled by minimum. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Nick Wellnhofer 1ae68e40 2024-06-06T22:55:15 python: Fix build with disabled modules
Nick Wellnhofer bd7cafdb 2024-05-20T23:46:37 meson: Add some TODO comments
Nick Wellnhofer 59254626 2024-05-14T12:08:17 threads: Deprecate remaining ThrDef functions
Nick Wellnhofer fdc5ff36 2024-05-02T16:23:04 parser: Always throw entity errors if external DTD is loaded When parsing with XML_PARSE_DTDLOAD, missing entities are always an error. Also consolidate behavior when validating. See b717abdd.
Nick Wellnhofer ae23a4ce 2024-04-30T17:26:28 unicode: Deprecate most xmlUCSIs* functions These don't seem to be used by downstream code.
Nick Wellnhofer bffef46c 2024-04-28T22:58:06 doc: Don't install example code
Nick Wellnhofer 1cdfece1 2024-04-28T18:33:40 memory: Remove memory debugging This is useless compared to sanitizers or valgrind and has a considerable performance impact if enabled accidentally.
Nick Wellnhofer 88169bfd 2024-04-28T17:54:36 tree: Deprecate xmlSetCompressMode
Nick Wellnhofer 05654cfe 2024-04-28T17:54:20 html: Deprecate htmlHandleOmittedElem
Nick Wellnhofer b717abdd 2024-04-22T15:42:39 parser: Consolidate error handling for undeclared entities Always use XML_WAR_UNDECLARED_ENTITY with warning error level in documents with external subset or parameter entities. Use XML_ERR_UNDECLARED_ENTITY otherwise.
Vincent Torri 5732ce56 2024-04-04T12:14:46 meson: Initial commit
Nick Wellnhofer dc2a03d4 2024-03-16T14:50:56 valid: Deprecate internal validation functions
Nick Wellnhofer 67e475b7 2024-02-19T11:09:39 http: Improve error message for HTTPS redirects
Nick Wellnhofer 63986c45 2024-01-22T21:02:16 parser: Report fatal error if document entity couldn't be loaded Only lower error level when loading entities. Fixes #667.
Nick Wellnhofer e8fb3d63 2024-01-02T17:45:54 parser: Convert some "internal errors" to meaningful codes
Nick Wellnhofer e45a4d71 2023-12-29T00:00:21 io: Always forward IO errors to global handler The HTTP module raises errors without context. This won't be fixed, so send them to the global error handler.
Nick Wellnhofer d944a415 2023-12-26T02:10:35 parser: Fix in-parameter-entity and in-external-dtd checks Use in ctxt->input->entity instead of ctxt->inputNr to determine whether we are inside a parameter entity. Stop using ctxt->external to check whether we're in an external DTD. This is signaled by ctxt->inSubset == 2.
Nick Wellnhofer 955c177f 2023-12-23T00:58:36 parser: Stop using 'directory' struct member This was only used as a pointless fallback for URI resolution.
Nick Wellnhofer 60841beb 2023-12-25T18:31:22 parser: Make XML_IO_NETWORK_ATTEMPT behave as before Always reported to generic error, not to parser context for backward compatibility. Several downstream test suites rely on this behavior.
Nick Wellnhofer 229e5ff7 2023-12-21T18:09:42 io: Remove support for HTTP POST This feature is unlikely to be used these days.
Nick Wellnhofer 1ef35663 2023-12-19T19:36:35 io: Always use unbuffered input Before, we often used unbuffered input via the lzma or gzip handlers, more or less inadvertently. Change the default file handlers from buffered (stdc FILE) to unbuffered (POSIX fds).
Nick Wellnhofer 7e511f35 2023-12-19T15:41:37 io: Pass error codes from xmlFileOpenReal to xmlNewInputFromFile This allows to report the reason why opening a file failed to the parser context and improve error messages. Now we can also remove the stat call before opening a file.
Nick Wellnhofer b2dbcc43 2023-12-19T13:33:59 io: Rework default callbacks Register a dummy callback struct for default callbacks. Handle them in a separate function which will later allow to return meaningful error codes.
Nick Wellnhofer c5a8aef2 2023-12-18T19:12:08 error: Refactor error reporting Introduce xmlStrVASPrintf, trying to handle buggy snprintf implementations. Introduce xmlSetError to set errors atomically. Introduce xmlUpdateError to set an error, fixing up node, file and line. Introduce helper function xmlRaiseMemoryError. Make legacy error handlers call xmlReportError, avoiding checks in xmlVRaiseError. Remove fragile support for getting file and line info from XInclude nodes.
Nick Wellnhofer d6812f3a 2023-12-14T13:35:13 Fix compiler warnings with disabled modules
Nick Wellnhofer 0e201722 2023-12-13T14:14:15 python: Fix callback signature Found with UBSan.
Nick Wellnhofer aca16fb3 2023-12-10T16:37:43 tree: Report malloc failures Fix many places where malloc failures aren't reported. Make some API function return an error code. Changing the return type from void to int is technically an ABI break but should be safe on most platforms. - xmlNodeSetContent - xmlNodeSetContentLen - xmlNodeAddContent - xmlNodeAddContentLen - xmlNodeSetBase Introduce new API functions that return a separate error code if a memory allocation fails. - xmlNodeGetAttrValue - xmlNodeGetBaseSafe - xmlGetNsListSafe Introduce private functions xmlTreeEnsureXMLDecl and xmlSplitQName4. Don't report low-level errors to the global error handler. Fix tree Introduce xmlGetNsListSafe Fix tree
Nick Wellnhofer 1c7f4c70 2023-11-27T12:10:09 nanohttp: Deprecate public API The long-term plan is to remove the built-in HTTP client. There are still a few downstream projects that use libxml2's client for other purposes. These users should get deprecation warnings now.
Nick Wellnhofer 7d6969d9 2023-11-23T15:48:52 Remove Trio Trio is a rather old cross-platform printf library which was bundled with libxml2. It was needed for ancient pre-C99 systems without snprintf and should be safe to remove these days.
makise-homura 6bc86405 2023-11-09T02:04:15 Avoid EDG deprecation warnings for LCC compiler
Nick Wellnhofer 56944c51 2023-11-04T18:54:21 python: Make sure to distribute new files Add pyproject.toml and tests/setup_test.py to Makefile.am.
Daniel Garcia Moreno 6f78efb0 2023-10-23T10:16:34 python: Make it compatible with python3.12 Python 3.12 removes distutils so it's mandatory to use setuptools with python >= 3.12. This patch prints a message when trying to run the setup.py script with a python >= 3.12 without setuptools and try to use the setuptools import by default. This patch also creates a new file, pyproject.toml [1], to prepare for building in modern systems. [1] https://peps.python.org/pep-0517/
Nick Wellnhofer 45470611 2023-09-21T23:52:52 error: Make xmlGetLastError return a const error This is a slight break of the API, but users really shouldn't modify the global error struct. The goal is to make xmlLastError use static buffers for its strings eventually. This should warn people if they're abusing the struct.
Nick Wellnhofer fc26934e 2023-09-21T23:29:18 memory: Fix memory debugging with Windows threads On Windows, malloc hooks can be called after the final call to xmlCleanupParser in various tests. This means that xmlMemMutex can still be accessed if memory debugging is enabled, so the mutex should not be cleaned. This also means that tests may report spurious memory leaks on Windows. The old implementation avoided the issue by keeping track of all global state objects in a doubly linked list, so they could be cleaned during xmlCleanupParser. But as far as I can tell all memory will be freed eventually, so this is mostly an issue with our test suite.