Skip to content

Added select.error handling to detect closed sockets in Engine.run#88

Closed
someposer wants to merge 1 commit into
python-zeroconf:masterfrom
someposer:master
Closed

Added select.error handling to detect closed sockets in Engine.run#88
someposer wants to merge 1 commit into
python-zeroconf:masterfrom
someposer:master

Conversation

@someposer
Copy link
Copy Markdown

When closing a zeroconf object, many times an error will be thrown. This error can be seen when running the registration.py example.

$ python examples/registration.py
Registration of a service, press Ctrl-C to exit...
^C
Unregistering...
Exception in thread zeroconf-Engine:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/site-packages/zeroconf.py", line 946, in run
rr, wr, er = select.select(rs, [], [], self.timeout)
error: (9, 'Bad file descriptor')

@hugovk
Copy link
Copy Markdown

hugovk commented Nov 25, 2016

👍 to this, it fixes home-assistant-libs/pychromecast#59 and home-assistant-libs/pychromecast#120 in pychromecast.

I'm not sure why the tests failed, but it's flake8 failures in files unrelated to this PR.

@hugovk
Copy link
Copy Markdown

hugovk commented Nov 26, 2016

This failed because of #92. PRs #93 and #94 offer two alternative fixes.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.03%) to 94.987% when pulling 4475cbc on someposer:master into 9035c6a on jstasiak:master.

1 similar comment
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 1, 2017

Coverage Status

Coverage decreased (-0.03%) to 94.987% when pulling 4475cbc on someposer:master into 9035c6a on jstasiak:master.

@hugovk
Copy link
Copy Markdown

hugovk commented Feb 1, 2017

#92 is fixed. The remaining failure is Python 2.6, which has since been dropped.

jstasiak added a commit that referenced this pull request Feb 3, 2017
Based on a pull request by someposer[1] (code adapted to work on
Python 3).

Fixes two pychromecast issues[2][3].

[1] #88
[2] home-assistant-libs/pychromecast#59
[3] home-assistant-libs/pychromecast#120
@jstasiak
Copy link
Copy Markdown
Collaborator

jstasiak commented Feb 3, 2017

Thanks for the patch, the e[0] bit doesn't work on Python 3 so I merged a patch based on this one (6e229f2), this request can be closed now.

@jstasiak jstasiak closed this Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants