Lxml

Latest version: v5.3.0

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 25 of 28

1.3.1

==================

Features added
--------------

* objectify.DataElement now supports setting values from existing data
elements (not just plain Python types) and reuses defined namespaces etc.

* E-factory support for lxml.objectify (``objectify.E``)

Bugs fixed
----------

* Better way to prevent crashes in Element proxy cleanup code

* objectify.DataElement didn't set up None value correctly

* objectify.DataElement didn't check the value against the provided type hints

* Reference-counting bug in ``Element.attrib.pop()``

1.3

================

Features added
--------------

* Module ``lxml.pyclasslookup`` module implements an Element class lookup
scheme that can access the entire tree in read-only mode to help determining
a suitable Element class

* Parsers take a ``remove_comments`` keyword argument that skips over comments

* ``parse()`` function in ``objectify``, corresponding to ``XML()`` etc.

* ``Element.addnext(el)`` and ``Element.addprevious(el)`` methods to support
adding processing instructions and comments around the root node

* ``Element.attrib`` was missing ``clear()`` and ``pop()`` methods

* Extended type annotation in objectify: cleaner annotation namespace setup
plus new ``deannotate()`` function

* Support for custom Element class instantiation in lxml.sax: passing a
``makeelement`` function to the ElementTreeContentHandler will reuse the
lookup context of that function

* '.' represents empty ObjectPath (identity)

* ``Element.values()`` to accompany the existing ``.keys()`` and ``.items()``

* ``collectAttributes()`` C-function to build a list of attribute
keys/values/items for a libxml2 node

* ``DTD`` validator class (like ``RelaxNG`` and ``XMLSchema``)

* HTML generator helpers by Fredrik Lundh in ``lxml.htmlbuilder``

* ``ElementMaker`` XML generator by Fredrik Lundh in ``lxml.builder.E``

* Support for pickling ``objectify.ObjectifiedElement`` objects to XML

* ``update()`` method on Element.attrib

* Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
a better handling of namespaces when moving elements between documents.

Bugs fixed
----------

* Removing Elements from a tree could make them lose their namespace
declarations

* ``ElementInclude`` didn't honour base URL of original document

* Replacing the children slice of an Element would cut off the tails of the
original children

* ``Element.getiterator(tag)`` did not accept ``Comment`` and
``ProcessingInstruction`` as tags

* API functions now check incoming strings for XML conformity. Zero bytes or
low ASCII characters are no longer accepted (AssertionError).

* XSLT parsing failed to pass resolver context on to imported documents

* passing '' as namespace prefix in nsmap could be passed through to libxml2

* Objectify couldn't handle prefixed XSD type names in ``xsi:type``

* More ET compatible behaviour when writing out XML declarations or not

* More robust error handling in ``iterparse()``

* Documents lost their top-level PIs and comments on serialisation

* lxml.sax failed on comments and PIs. Comments are now properly ignored and
PIs are copied.

* Possible memory leaks in namespace handling when moving elements between
documents

Other changes
-------------

* major restructuring in the documentation

1.2.1

==================

Bugs fixed
----------

* Build fixes for MS compiler

* Item assignments to special names like ``element["text"]`` failed

* Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
to access

* The pattern for attribute names in ObjectPath was too restrictive

1.2

================

Features added
--------------

* Rich comparison of QName objects

* Support for regular expressions in benchmark selection

* get/set emulation (not .attrib!) for attributes on processing instructions

* ElementInclude Python module for ElementTree compatible XInclude processing
that honours custom resolvers registered with the source document

* ElementTree.parser property holds the parser used to parse the document

* setup.py has been refactored for greater readability and flexibility

* --rpath flag to setup.py to induce automatic linking-in of dynamic library
runtime search paths has been renamed to --auto-rpath. This makes it
possible to pass an --rpath directly to distutils; previously this was being
shadowed.

Bugs fixed
----------

* Element instantiation now uses locks to prevent race conditions with threads

* ElementTree.write() did not raise an exception when the file was not writable

* Error handling could crash under Python <= 2.4.1 - fixed by disabling thread
support in these environments

* Element.find*() did not accept QName objects as path

Other changes
-------------

* code cleanup: redundant _NodeBase super class merged into _Element class
Note: although the impact should be zero in most cases, this change breaks
the compatibility of the public C-API

1.1.2

==================

Features added
--------------

* Data elements in objectify support repr(), which is now used by dump()

* Source distribution now ships with a patched Pyrex

* New C-API function makeElement() to create new elements with text,
tail, attributes and namespaces

* Reuse original parser flags for XInclude

* Simplified support for handling XSLT processing instructions

Bugs fixed
----------

* Parser resources were not freed before the next parser run

* Open files and XML strings returned by Python resolvers were not
closed/freed

* Crash in the IDDict returned by XMLDTDID

* Copying Comments and ProcessingInstructions failed

* Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()

* Memory leak when garbage collecting tailed root elements

* HTML script/style content was not propagated to .text

* Show text xincluded between text nodes correctly in .text and .tail

* 'integer * objectify.StringElement' operation was not supported

1.1.1

==================

Features added
--------------

* XSLT profiling support (``profile_run`` keyword)

* countchildren() method on objectify.ObjectifiedElement

* Support custom elements for tree nodes in lxml.objectify

Bugs fixed
----------

* lxml.objectify failed to support long data values (e.g., "123L")

* Error messages from XSLT did not reach ``XSLT.error_log``

* Factories objectify.Element() and objectify.DataElement() were missing
``attrib`` and ``nsmap`` keyword arguments

* Changing the default parser in lxml.objectify did not update the factories
Element() and DataElement()

* Let lxml.objectify.Element() always generate tree elements (not data
elements)

* Build under Windows failed ('\0' bug in patched Pyrex version)

Page 25 of 28

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.