gourmand crashed with ImportError in /usr/lib/python3/dist-packages/extruct/xmldom.py: cannot import name '_ElementStringResult' from 'lxml.etree' (/usr/lib/python3/dist-packages/lxml/etree.cpython-312-x86_64-linux-gnu.so)

Bug #2066997 reported by Steve Langasek
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
extruct (Ubuntu)
Fix Released
Medium
Unassigned
Noble
In Progress
Critical
Unassigned
gourmand (Ubuntu)
New
Medium
Unassigned
Noble
New
Undecided
Unassigned

Bug Description

[ Impact ]
The extruct package is a python module that cannot be used in noble because it is incompatible with the lxml module that is shipped in noble.

[ Test plan ]
1. bad:
$ python3 -c 'import extruct'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/extruct/__init__.py", line 1, in <module>
    from ._extruct import SYNTAXES, extract
  File "/usr/lib/python3/dist-packages/extruct/_extruct.py", line 9, in <module>
    from extruct.dublincore import DublinCoreExtractor
  File "/usr/lib/python3/dist-packages/extruct/dublincore.py", line 6, in <module>
    from extruct.utils import parse_html
  File "/usr/lib/python3/dist-packages/extruct/utils.py", line 5, in <module>
    from extruct.xmldom import XmlDomHTMLParser
  File "/usr/lib/python3/dist-packages/extruct/xmldom.py", line 9, in <module>
    from lxml.etree import (
ImportError: cannot import name '_ElementStringResult' from 'lxml.etree' (/usr/lib/python3/dist-packages/lxml/etree.cpython-312-x86_64-linux-gnu.so). Did you mean: '_ElementUnicodeResult'?
$

2. good:
$ python3 -c 'import extruct'
$

[ Where problems could occur ]
The package as shipped is completely unusable so runtime regressions are not possible.

The Debian fix for this includes introducing an additional dependency, so new install-time failures are possible but unlikely. No analysis has been done to check for this.

[ Original description ]
Well, for the fourth Ubuntu release running, gourmand is completely unusable.

Downgrading again to my local copy of gourmand 1.1.0+really1.0.0-3.

ProblemType: Crash
DistroRelease: Ubuntu 24.04
Package: gourmand 1.1.0+really1.1.0~rc3-3
ProcVersionSignature: Ubuntu 6.8.0-31.31-generic 6.8.1
Uname: Linux 6.8.0-31-generic x86_64
NonfreeKernelModules: zfs
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Thu May 23 16:13:30 2024
ExecutablePath: /usr/bin/gourmand
InstallationDate: Installed on 2019-12-23 (1613 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
InterpreterPath: /usr/bin/python3.12
JournalErrors: -- No entries --
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/gourmand --database-url=postgresql://borges/recipes
Python3Details: /usr/bin/python3.12, Python 3.12.3, python3-minimal, 3.12.3-0ubuntu1
PythonArgs: ['/usr/bin/gourmand', '--database-url=postgresql://borges/recipes']
PythonDetails: N/A
SourcePackage: gourmand
Title: gourmand crashed with ImportError in /usr/lib/python3/dist-packages/extruct/xmldom.py: cannot import name '_ElementStringResult' from 'lxml.etree' (/usr/lib/python3/dist-packages/lxml/etree.cpython-312-x86_64-linux-gnu.so)
UpgradeStatus: Upgraded to noble on 2024-05-22 (1 days ago)
UserGroups: adm cdrom dip libvirt lpadmin lxd plugdev sambashare sbuild src sudo
modified.conffile..etc.apport.crashdb.conf: [modified]
mtime.conffile..etc.apport.crashdb.conf: 2024-05-23T16:12:43.275502

Revision history for this message
Steve Langasek (vorlon) wrote :
tags: removed: need-duplicate-check
Changed in extruct (Ubuntu):
importance: Undecided → Medium
Changed in gourmand (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Steve Langasek (vorlon) wrote :

Probably fixed by:

extruct (0.16.0-4) unstable; urgency=medium

  * Add upstream patch to add support for python3 lxml >= 5.2.0 and
    python3-lxml-html-clean to Depends.

 -- Christian Marillat <email address hidden> Fri, 19 Apr 2024 11:44:13 +0200

information type: Private → Public
Changed in extruct (Ubuntu):
status: New → Fix Released
Changed in extruct (Ubuntu Noble):
importance: Undecided → Critical
Revision history for this message
Benjamin Drung (bdrung) wrote :

extruct has no autopkgtest. How about adding at least autopkgtest-pkg-python to catch those kind of issues earlier next time?

Steve Langasek (vorlon)
description: updated
Changed in extruct (Ubuntu Noble):
status: New → In Progress
Steve Langasek (vorlon)
description: updated
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.