5.1.1 removed the "_ElementStringResult" class

Bug #2059793 reported by Michael Deeb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Won't Fix
Undecided
Unassigned

Bug Description

After rebuilding, I discovered that there was a breaking change between 5.1.0 and 5.1.1 in a dependency I'm using.

## --
ImportError: cannot import name '_ElementStringResult' from 'lxml.etree' (/usr/local/lib/python3.12/site-packages/lxml/etree.cpython-312-x86_64-linux-gnu.so). Did you mean: '_ElementUnicodeResult'?
## --

Revision history for this message
scoder (scoder) wrote :

Could you please report the problem to the dependency? They are apparently using private classes of lxml in their code.
Can you share which library this is?

Changed in lxml:
status: New → Triaged
Revision history for this message
scoder (scoder) wrote :

To clarify, "_ElementStringResult" and "_ElementStringResult" are both private classes (as is basically everything that is underscore-prefixed in lxml's API). The first has become unused by the changes in lxml 5.1.0, could never reasonably be used outside of lxml, and was now removed. This is a simple cleanup, not a change that breaks the public API or its usage.

The library basically has two options: stick with lxml 5.0.x if they want to depend on the class (it's up to them to do that, and it might be a viable choice for you as well for the time being), or remove their usage of the non-public class.

I'm closing this as "won't fix" because this class will be removed either way, even if it was temporarily added back as a dummy name. It's really not something that users should ever touch.

summary: - 5.1.1 breaking change
+ 5.1.1 removed the "_ElementStringResult" class
Changed in lxml:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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