Sometimes after initializing a ServiceBrowser instance, we get the following exception:
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.2/threading.py", line 740, in _bootstrap_inner
self.run()
File "/usr/lib/python3/dist-packages/zeroconf.py", line 1063, in run
handler(self.zc)
File "/usr/lib/python3/dist-packages/zeroconf.py", line 1010, in <lambda>
lambda zeroconf: self._service_state_changed.fire(
AttributeError: 'ServiceBrowser' object has no attribute '_service_state_changed'
This is because the ServiceBrowser._service_state_changed signal gets initialized after a listener gets added to the Zeroconf instance, which in turn can register a service change before the initialization.
Sometimes after initializing a ServiceBrowser instance, we get the following exception:
This is because the
ServiceBrowser._service_state_changedsignal gets initialized after a listener gets added to theZeroconfinstance, which in turn can register a service change before the initialization.