◐ Shell
clean mode source ↗

fix: tolerate removing unregistered record listener by bluetoothbot · Pull Request #1783 · python-zeroconf/python-zeroconf

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

Demonstrates GHSA-5pv9-xcmm-gqc7: set.remove() raises KeyError, which
the except ValueError clause cannot catch.
self.listeners is a set, so .remove() raises KeyError, never ValueError —
the existing except clause could not catch the only realistic failure
mode. Switch to the set-native discard idiom so removing a listener that
was never registered (e.g. during teardown / reconnect sequences) no
longer breaks the shutdown flow.

bdraco