Blueman exception "AttributeError: 'ManagerDeviceMenu' object has no attribute 'SelectedDevice'" when disconnecting device

Bug #2025397 reported by Craig Ringer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
blueman (Ubuntu)
New
Undecided
Unassigned

Bug Description

I installed blueman and used it to disconnect my Bluetooth audio headset (as it's incredibly annoying that GNOME insists on auto-connecting to it when I only want to use it on my mobile, but I don't want to have to unpair and re-pair every time).

When I double clicked on the headset in the blueman device list, the following exception was printed to the console:

```
$ /usr/bin/blueman-manager
Exception ignored on calling ctypes callback function: <bound method PulseAudioUtils.__list_callback of <PulseAudioUtils.PulseAudioUtils object at 0x7f22daa67e40 (blueman+main+PulseAudioUtils+PulseAudioUtils at 0x1607b40)>>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/blueman/main/PulseAudioUtils.py", line 240, in __list_callback
    info["handler"](entry_info, False)
  File "/usr/lib/python3/dist-packages/blueman/main/PulseAudioUtils.py", line 316, in handler
    callback(self.__card_info(entry_info))
  File "/usr/lib/python3/dist-packages/blueman/plugins/manager/PulseAudioProfile.py", line 55, in get_card_cb
    self.regenerate_with_device(card["proplist"]["device.string"])
  File "/usr/lib/python3/dist-packages/blueman/plugins/manager/PulseAudioProfile.py", line 42, in regenerate_with_device
    if inst.SelectedDevice['Address'] == device_addr and not inst.is_popup:
       ^^^^^^^^^^^^^^^^^^^
AttributeError: 'ManagerDeviceMenu' object has no attribute 'SelectedDevice'
```

Context:

```
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.04
Release: 23.04
Codename: lunar
```

```
$ dpkg -l blueman pulseaudio-utils
||/ Name Version Architecture Description
+++-================-=====================-============-==================================================
ii blueman 2.3.5-2build1 amd64 Graphical bluetooth manager
ii pulseaudio-utils 1:16.1+dfsg1-2ubuntu3 amd64 Command line tools for the PulseAudio sound server
```

```
$ pip list --user
$
```

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.