lxml adds duplicate namespace parameters

Bug #2048693 reported by kesara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Triaged
Undecided
Unassigned

Bug Description

Since lxml 5.0.0, lxml adds duplicate namespace parameters.
This behaviour seems to happen only when DTD is defined and `attribute_defaults` is set to `True`.

output of test.py:
```
Python : sys.version_info(major=3, minor=10, micro=13, releaselevel='final', serial=0)
lxml.etree : (5, 1, 0, 0)
libxml used : (2, 12, 3)
libxml compiled : (2, 12, 3)
libxslt used : (1, 1, 39)
libxslt compiled : (1, 1, 39)
[('name', 'foo'), ('{http://www.w3.org/XML/1998/namespace}space', 'preserve'), ('{http://www.w3.org/XML/1998/namespace}space', 'preserve')]
```

`root[0].items()` has duplicate `'{http://www.w3.org/XML/1998/namespace}space` entries.

Revision history for this message
kesara (kesara) wrote :
kesara (kesara)
summary: - lxml duplicatel namespace parameters
+ lxml adds duplicate namespace parameters
Revision history for this message
scoder (scoder) wrote :

This is most likely not due to a change in lxml but in libxml2. lxml 5.0 uses libxml2 2.12.3.

It might be related to this change:
https://gitlab.gnome.org/GNOME/libxml2/-/commit/8d42c447d616fb81c6f8f84a491ef50d882366f5

Changed in lxml:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.