[New-bugs-announce] [issue17011] ElementPath ignores different namespace mappings for the same path expression

Stefan Behnel report at bugs.python.org
Tue Jan 22 08:16:24 CET 2013


New submission from Stefan Behnel:

There's a bug originally report for lxml that also applies to ElementTree:

https://github.com/lxml/lxml/issues/95

Passing different namespace mappings into the Element.find*() methods will always reuse the first one due to incorrect caching based only on the literal path, not all parameters. My fix is here:

https://github.com/lxml/lxml/commit/8bafbdc13ffb4fb8436eda01594780aac4735528

The lookup performance regression when a namespace mapping is passed (sorting etc.) is acceptable as most use cases won't pass any namespaces anyway, so this is a problem that rarely shows in practice.

----------
components: XML
messages: 180366
nosy: scoder
priority: normal
severity: normal
status: open
title: ElementPath ignores different namespace mappings for the same path expression
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17011>
_______________________________________


More information about the New-bugs-announce mailing list