python


Log

Author Commit Date CI Message
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.
Nick Wellnhofer 6c4ea468 2023-09-21T21:31:52 python: Fix tests Revert part of commit 138213ac.
Nick Wellnhofer 89ee0369 2023-09-21T15:13:16 python: Fix potential crash in tests/thread2.py Memory debugging must be initialized.
Nick Wellnhofer d6ba4033 2023-09-20T20:49:59 globals: Move remaining declarations to correct places globals.h is now deprecated. Sanity is restored.
Nick Wellnhofer 11a1839d 2023-09-20T17:54:48 globals: Move remaining globals back to correct header files This undoes a lot of damage.
Nick Wellnhofer db8b9722 2023-09-20T13:56:16 parser: Deprecate global parser options Note that setting global options has no effect anyway when using any of the modern parser API functions which take an option argument like xmlReadMemory or when using xmlCtxtUseOptions. Global options only have an effect when using old API functions xmlParse* or xmlSAXParse* or when using an xmlParserCtxt without calling xmlCtxtUseOptions. Unfortunately, many downstream projects still modify global parser options often without realizing that it has no effect. If necessary, switch to the modern API. Then you can safely remove all code that changes global options. Here's a list of deprecated functions and global variables together with the corresponding parser options. - xmlSubstituteEntitiesDefault, xmlSubstituteEntitiesDefaultValue Parser option XML_PARSE_NOENT - xmlKeepBlanksDefault, xmlKeepBlanksDefaultValue Inverse of parser option XML_PARSE_NOBLANKS - xmlPedanticParserDefault, xmlPedanticParserDefaultValue Parser option XML_PARSE_PEDANTIC - xmlLineNumbersDefault, xmlLineNumbersDefaultValue Always enabled by new API - xmlDoValidityCheckingDefaultValue Parser option XML_PARSE_DTDVALID - xmlGetWarningsDefaultValue Inverse of parser option XML_PARSE_NOWARNING - xmlLoadExtDtdDefaultValue Parser options XML_PARSE_DTDLOAD and XML_PARSE_DTDATTR
Nick Wellnhofer 4e1c13eb 2023-09-18T14:45:10 debug: Remove debugging code This is barely useful these days and only clutters the code base.
Nick Wellnhofer bbd918b2 2023-08-29T15:56:37 parser: Fix detection of null bytes Also suppress misleading extra errors. Fixes #122.
Nick Wellnhofer 138213ac 2023-08-15T12:49:27 python: Fix tests on MinGW Add the directory containing libxml2.dll with os.add_dll_directory to make tests work on MinGW. This has changed in Python 3.8 but for some reason, the issue only turned up with Python 3.11 on MinGW. Contrary to documentation, copying libxml2.dll into the directory containing the .pyd file doesn't work.
Nick Wellnhofer b463b38b 2023-04-30T16:19:28 .gitignore: Split up and rearrange .gitignore files
Nick Wellnhofer 886bf4e6 2023-04-30T15:35:47 Stop calling xmlMemoryDump This was used to check for memory leaks but could potentially create a .memdump file. These days, there are better ways to check for memory leaks.
Nick Wellnhofer 3ffcc03b 2023-03-13T19:38:41 parser: Deprecate more internal functions
David Kilzer cb1b8b85 2023-04-10T13:06:18 xmlValidatePopElement() can return invalid value (-1) Covered by: test/VC/ElementValid5 This only affects XML Reader API with LIBXML_REGEXP_ENABLED and LIBXML_VALID_ENABLED turned on. * result/VC/ElementValid5.rdr: - Update result to add missing error message. * python/tests/reader2.py: * result/VC/ElementValid6.rdr: * result/VC/ElementValid7.rdr: * result/valid/781333.xml.err.rdr: - Update result to fix grammar issue. * valid.c: (xmlValidatePopElement): - Check return value of xmlRegExecPushString() to handle -1, and assign 'ret = 0;' to return 0 from xmlValidatePopElement(). This change affects xmlTextReaderValidatePop() from xmlreader.c. - Fix grammar of error message by changing 'child' to 'children'.
Nick Wellnhofer 74aa61e0 2023-01-22T13:09:03 parser: Halt parser on DTD errors If we try to continue parsing after an error in the internal or external subset, entity expansion accounting gets more complicated. Simply halt the parser. Found with libFuzzer.
Nick Wellnhofer c74e5903 2022-12-21T22:24:50 Remove ancient TODOs
Nick Wellnhofer b47ebf04 2022-12-21T00:02:47 parser: Deprecate xmlString*DecodeEntities These are internal functions.
Ross Burton 4762c856 2022-12-06T21:40:01 Use python3 not python As per https://peps.python.org/pep-0394/, the python binary can be one of the following options: - Python 2 - Python 3 - Not exist All of the scripts in libxml2 use 'python', which may not exist. As Python 2 reached EOL on the 1st January 2020, it's safe to move the scripts to use python3 explicitly.
Ross Burton 0ac8c15e 2022-12-06T15:48:55 python/tests/reader2: use absolute paths everywhere The expected errors contain an relative path, but the messages from the parser contain absolute paths. However, due to the tests not actually failing if there was an error this wasn't noticed. Instead of putting relative paths in the expected messages use format() to embed the correct absolute path. Also use os.path.join() consistently when constructing paths to ensure uniformly formatted paths.
Ross Burton b9ba5e1d 2022-12-06T15:34:04 python/tests/reader2: always exit(1) if a test fails Batch up the errors in the first parse tests and ensure that the last tests exit with an error if they fail. Also remove an unused import.
Nick Wellnhofer 82bd2c37 2022-11-25T18:09:15 python: Fix memory leak checks xmlInitParser doesn't allocate memory anymore, so the checks can be simplified.
Chun-wei Fan 707ade22 2022-11-22T14:56:58 Visual Studio builds: Allow silencing deprecation warnings Define XML_IGNORE_DEPRECATION_WARNINGS and the corresponding XML_POP_WARNINGS for Visual Studio, and consequently define XML_IGNORE_FPTR_CAST_WARNINGS so that we do not get a compiler warning on Visual Studio by doing a __pragma(warning(pop)) without a corresponding __pragma(warning(push)). Also correct the documentation a bit for XML_POP_WARNINGS.
Nick Wellnhofer 97c0a9cf 2022-11-22T17:01:39 tests: Fix use-after-free in Python tests The nodeset must be freed before the document. Fixes #443.
Chun-wei Fan d7e698fc 2022-11-18T17:36:14 python/setup.py.in: Improve Windows import patching Move up the altImport function so that we ensure that it can be referred to and streamline it a bit, since we no longer attempt to build the libxslt Python bits here, at least on Windows.
Nick Wellnhofer ea8f7c92 2022-09-06T00:47:00 autotools: Disable parallel Python build Makefile rules with multiple output files don't work reliably with parallel builds. There are several ways to fix this issue with GNU Make, but they aren't portable. I'd be really interested in a totally reliable, cross-platform solution to this problem. .NOTPARALLEL is also understood by BSD make, at least.
Nick Wellnhofer 9d19c169 2022-09-06T00:21:28 python: Don't output missing generators during build
Nick Wellnhofer ad6f10a8 2022-09-04T17:21:51 Fix Python build on Windows Build Python bindings with -no-undefined on Windows. Remove libs that should already be set by PKG_CHECK_MODULE.
Nick Wellnhofer 0d901258 2022-09-04T16:41:43 Fix Windows compiler warnings in python/types.c
Nick Wellnhofer 71736b4e 2022-09-04T16:16:37 Fix libxml_PyFileGet Broken in commit 75cdb6dd.
Nick Wellnhofer 513d65fe 2022-09-02T16:45:06 Use AM_CFLAGS and AM_LDFLAGS consistently
Nick Wellnhofer 75cdb6dd 2022-09-02T16:47:25 Fix unused variable warning in python/types.c
Nick Wellnhofer ce8f3d11 2022-08-29T23:53:40 Fix libxml_PyFileGet with stdout on macOS macOS returns O_RDWR for standard file descriptors, but fails to write to stdout or stderr when opened with fdopen(dup_fd, "rw").
Nick Wellnhofer b1a09618 2022-08-29T17:21:19 Migrate from PyEval_ to PyObject_ PyEval_ functions are deprecated. Fixes #208.
Nick Wellnhofer b0916e0e 2022-08-26T17:57:58 Also clean *.pyc files for Python 2
Nick Wellnhofer 58fc89e8 2022-08-25T20:57:30 Deprecate internal parser functions
Nick Wellnhofer a308c0cd 2022-08-25T20:18:16 Deprecate old HTML SAX API
Nick Wellnhofer 51035c53 2022-08-25T19:53:04 Generate deprecation warnings for old SAX API
Nick Wellnhofer 7f7961df 2022-08-25T13:47:16 Remove generated files from distribution - libxml2.spec - libxml-2.0.pc - xml2-config - include/libxml/xmlversion.h - python/libxml2.py - python/libxml2-export.c - python/libxml2-py.c - python/libxml2-py.h - python/libxml2class.py - python/libxml2class.txt - python/setup.py
Nick Wellnhofer 75b5bc2b 2022-08-23T20:57:49 Deprecate some global variables Most of these should be completely unused.
Nick Wellnhofer d8f05db8 2022-05-14T22:28:19 Fix Python tests on macOS
Nick Wellnhofer 67070107 2022-04-20T23:17:14 Add configuration flag for XPointer locations support Add a new configuration flag that controls whether the outdated support for XPointer locations (ranges and points) is enabled. --with-xptr-locs # Autotools LIBXML2_WITH_XPTR_LOCS # CMake 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. The flag defaults to "off" and support for this extensions has to be requested explicitly. The relevant API functions are deprecated.
Nick Wellnhofer cacf6555 2022-04-13T16:43:15 Fix compiler warnings in Python code Add more deprecated functions to avoid compiler warnings when building the Python bindings.
David Seifert a62b31f4 2022-04-06T19:57:30 Use portable python shebangs * In conda or Gentoo Prefix, we don't want to use the system python and instead rely on PATH lookup.
Nick Wellnhofer 3f74e42b 2022-04-04T05:19:33 Simplify 'make check' targets
David Seifert 0137d987 2022-03-30T22:00:50 python/tests: open() relative to test scripts
David Seifert 438209f3 2022-03-30T16:51:15 python/Makefile.am: nest python docs in $(docdir)
David Seifert 9e304353 2022-03-30T16:51:14 python/Makefile.am: rely on global AM_INIT_AUTOMAKE * Even Debian oldoldstable has Automake 1.15 available nowadays.
David Seifert d9335077 2022-03-29T13:37:16 Use AM_PATH_PYTHON/PKG_CHECK_MODULES for python bindings * `AM_PATH_PYTHON` is a much more common idiom for building and installing python modules than writing your own. * It also makes cross-compiling the python bindings possible. Previously the `PYTHON_CFLAGS`/`PYTHON_LIBS` would have been based on the `--build` python and not the `--host` python. By using `pkg-config`, we can always redirect the python-X.Y.pc. Bug: https://bugs.gentoo.org/582130
Nick Wellnhofer 40483d0c 2022-03-06T13:55:48 Deprecate module init and cleanup functions These functions shouldn't be part of the public API. Most init functions are only thread-safe when called from xmlInitParser. Global variables should only be cleaned up by calling xmlCleanupParser.
Nick Wellnhofer 4a8c71eb 2022-03-04T03:35:57 Remove DOCBparser This code has been broken and deprecated since version 2.6.0, released in 2003. Because of a bug in commit 961b535c, DOCBparser.c was never compiled since 2012. I couldn't find a Debian package using any of its symbols, so it seems safe to remove this module.
Nick Wellnhofer ebc50097 2022-03-01T13:57:16 Warn when using deprecated functions from Python bindings This requires Python code to be run with -Wd.
Nick Wellnhofer 5bc5f076 2022-02-24T18:34:39 Fix build with older Python versions ModuleNotFoundError is only available since Python 3.6. Use the superclass ImportError instead. Fixes commit 3cc64a89. Fixes #347.
Nick Wellnhofer b057239b 2022-02-22T11:52:38 More fixes to --without-valid build Fix runtest and Python bindings when building --without-valid. The Python tests still fail. There doesn't seem to be a mechanism to disable tests depending on feature flags.
Nick Wellnhofer 004fe9de 2022-02-20T19:02:31 Deprecate IDREF-related functions in valid.h These functions are only needed internally for validation. xmlGetRefs is inherently unsafe because the ref table isn't updated if attributes are removed (unlike the ids table). None of the Ubuntu 20.04 packages depending on libxml2 use any of these functions (except xmlFreeRefTable in libxslt), so it seems perfectly safe to deprecate them. Remove xmlIsRef and xmlRemoveRef from the Python bindings.
Nick Wellnhofer f2ad86fa 2022-02-17T19:05:26 Remove SVN keyword anchors
Nick Wellnhofer 10891111 2022-02-13T22:52:53 Redirect links to xmlsoft.org Documentation and releases are now available on gitlab.gnome.org.
Chun-wei Fan 3cc64a88 2021-07-22T15:46:38 setup.py.in: Try to import setuptools This way, we can build binary wheels easily if needed