Activity log for bug #1981760

Date Who What changed Old value New value Message
2022-07-14 20:43:17 Pekka Klärck bug added bug
2022-07-15 06:44:08 scoder lxml: importance Undecided Low
2022-07-15 06:44:08 scoder lxml: status New Fix Committed
2022-07-15 06:44:08 scoder lxml: assignee scoder (scoder)
2022-07-15 06:45:57 scoder lxml: milestone 4.9.2
2022-07-15 13:29:12 Pekka Klärck description We have code that operates with various collections and when working with dictionaries it checks is the object a dictionary with `isinstance(obj, Mapping)`. That works fine in general, including with the standard ElementTree, but fails with `lxml.etree._Attrib`. To reproduce: >>> from xml.etree.ElementTree import XML >>> isinstance(XML('<x/>').attrib, Mapping) True >>> from collections.abc import Mapping >>> from xml.etree.ElementTree import XML >>> isinstance(XML('<x/>').attrib, Mapping) True >>> from lxml.etree import XML >>> isinstance(XML('<x/>').attrib, Mapping) False Required version info: Python : sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0) lxml.etree : (4, 9, 1, 0) libxml used : (2, 9, 14) libxml compiled : (2, 9, 14) libxslt used : (1, 1, 35) libxslt compiled : (1, 1, 35) We have code that operates with various collections and when working with dictionaries it checks is the object a dictionary with `isinstance(obj, Mapping)`. That works fine in general, including with the standard ElementTree, but fails with `lxml.etree._Attrib`. To reproduce: >>> from collections.abc import Mapping >>> from xml.etree.ElementTree import XML >>> isinstance(XML('<x/>').attrib, Mapping) True >>> from lxml.etree import XML >>> isinstance(XML('<x/>').attrib, Mapping) False Required version info: Python : sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0) lxml.etree : (4, 9, 1, 0) libxml used : (2, 9, 14) libxml compiled : (2, 9, 14) libxslt used : (1, 1, 35) libxslt compiled : (1, 1, 35)
2022-12-20 12:28:05 scoder lxml: status Fix Committed Fix Released