Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bluezdbus/manager: ignore KeyError when properties removed #1110

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Fixed
------
* Fixed crash when getting services in WinRT backend.
* Fixed cache mode when retrying get services in WinRT backend.
* Fixed ``KeyError`` crash in BlueZ backend when removing non-existent property. Fixes #1107.

`0.19.1`_ (2022-10-29)
======================
Expand Down
7 changes: 6 additions & 1 deletion bleak/backends/bluezdbus/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,12 @@ def _parse_msg(self, message: Message):
self_interface.update(unpack_variants(changed))

for name in invalidated:
del self_interface[name]
try:
del self_interface[name]
except KeyError:
# sometimes there BlueZ tries to remove properties
# that were never added
pass

# then call any callbacks so they will be called with the
# updated state
Expand Down