Package: python3-networkmanager
Version: 2.2-2

In Debian Bookworm with these two package versions

ii  network-manager                          1.42.4-1 armhf
network management
ii  python3-networkmanager             2.2-2  all          Python 3
interface to the NetworkManager D-Bus interface


An exception occurs when calling GetDevices() on a network manager
object via the python bindings

File "<string>", line 8, in GetDevices
  File "/usr/lib/python3/dist-packages/NetworkManager.py", line 584,
in to_python
    val = fixups.base_to_python(val)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/NetworkManager.py", line 647,
in base_to_python
    return [fixups.base_to_python(x) for x in val]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/NetworkManager.py", line 647,
in <listcomp>
    return [fixups.base_to_python(x) for x in val]
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/NetworkManager.py", line 660,
in base_to_python
    return globals()[classname](val)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/NetworkManager.py", line 353, in __new__
    klass = device_class(obj.Get('org.freedesktop.NetworkManager.Device',
'DeviceType', dbus_interface='org.freedesktop.DBus.Properties'))
            
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/NetworkManager.py", line 373,
in device_class
    return {
           ^
KeyError: dbus.UInt32(32, variant_level=1)

This is for the same reason as the, now closed #984983 except that it
is for a new device type (32 = NM_DEVICE_TYPE_LOOPBACK) whereas that
one was for types 30 and 31.

It seems rather fragile manually ensuring that the network manager
bindings and its python bindings are in sync.
Maybe the direct dictionary lookup with[] should be replaced with a
.get() using a sensible default?

Regards,

Martin Fuzzey
-- 

Martin Fuzzey | Software Architect
Besançon | FR
Mobile: (+33) 6 77 15 85 82
martin.fuzzey@flowbird.group | www.flowbird.group

Reply via email to