Bug#1068255: dnf: dnf aborts with ImportError: cannot import name '_module' from partially initialized module 'libdnf'

2024-04-20 Thread Luca Boccassi
Control: reassign -1 dh-python 6.20240401
Control: retitle -1 dh-python: dh_python3 loses cpython module name when 
renaming shared object

On Tue, 2 Apr 2024 22:47:12 +0300 Michael Ivanov 
wrote:
> Package: dnf
> Version: 4.14.0-4.1
> Severity: grave
> Justification: renders package unusable
> 
> Dear Maintainer,
> 
> I have just tried to start up dnf and it aborts with a following
error:
> 
> Traceback (most recent call last):
> File "/usr/bin/dnf", line 61, in 
> from dnf.cli import main
> File "/usr/lib/python3/dist-packages/dnf/__init__.py", line 30, in

> import dnf.base
> File "/usr/lib/python3/dist-packages/dnf/base.py", line 29, in

> import libdnf.transaction
> File "/usr/lib/python3/dist-packages/libdnf/__init__.py", line 13, in
> 
> from . import module
> File "/usr/lib/python3/dist-packages/libdnf/module.py", line 10, in

> from . import _module
> ImportError: cannot import name '_module' from partially initialized
module
> 'libdnf' (most likely due to a circular import)
(/usr/lib/python3/dist-
> packages/libdnf/__init__.py)
> 
> Python version is 3.11.8 (python package version is 3.11.8-3+b2)

This is caused by dh_python3. A regression was introduced at some
point, and when renaming the cpython shared object dh_python3 loses the
name, and _module.so is renamed to _.cpython-311-x86_64-linux-gnu.so
when libdnf is built, breaking the import at runtime:

I: dh_python3 fs:418: renaming _module.so to _.cpython-311-x86_64-linux-gnu.so

https://buildd.debian.org/status/fetch.php?pkg=libdnf=amd64=0.73.1-1=1713175615=0

Renaming the shared library manually to the expected filename makes dnf
work again.

Reassigning to dh-python. A binnmu of libdnf (and any other affected
package) will be needed once resolved and uploaded.

-- 
Kind regards,
Luca Boccassi


signature.asc
Description: This is a digitally signed message part


Bug#1068255: dnf: dnf aborts with ImportError: cannot import name '_module' from partially initialized module 'libdnf'

2024-04-02 Thread Michael Ivanov

Package: dnf
Version: 4.14.0-4.1
Severity: grave
Justification: renders package unusable

Dear Maintainer,

I have just tried to start up dnf and it aborts with a following error:

Traceback (most recent call last):
File "/usr/bin/dnf", line 61, in 
from dnf.cli import main
File "/usr/lib/python3/dist-packages/dnf/__init__.py", line 30, in 
import dnf.base
File "/usr/lib/python3/dist-packages/dnf/base.py", line 29, in 
import libdnf.transaction
File "/usr/lib/python3/dist-packages/libdnf/__init__.py", line 13, in

from . import module
File "/usr/lib/python3/dist-packages/libdnf/module.py", line 10, in 
from . import _module
ImportError: cannot import name '_module' from partially initialized module
'libdnf' (most likely due to a circular import) (/usr/lib/python3/dist-
packages/libdnf/__init__.py)

Python version is 3.11.8 (python package version is 3.11.8-3+b2)


-- System Information:
Debian Release: trixie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.7.9-amd64 (SMP w/20 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE 
not set

Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dnf depends on:
ii dnf-data 4.14.0-4.1
ii libmodulemd2 2.14.0-3+b1
ii python3 3.11.8-1
ii python3-dbus 1.3.2-5+b2
ii python3-dnf 4.14.0-4.1
ii sqlite3 3.45.2-1

dnf recommends no packages.

dnf suggests no packages.

-- no debconf information