Skip to content

ServiceBrowser initialization will crash when an answer arrives too fast #56

@herczy

Description

@herczy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions