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

Fixes #119 per comments #120

Merged
merged 3 commits into from Nov 15, 2016
Merged

Fixes #119 per comments #120

merged 3 commits into from Nov 15, 2016

Conversation

strictlymike
Copy link
Contributor

Hi @jaraco, I wrote this to handle cases such as where an IRC client might initiate a PING command and then immediately disconnect. Without this fix, the serve_forever() routine emits exception output on the console whenever this occurs. In my testing, this fix causes it to disconnect gracefully. Let me know if I'm missing anything. Thanks!

@jaraco
Copy link
Owner

jaraco commented Nov 15, 2016

This looks reasonable. I'm not familiar with the code so I have one question I'd like to answer first. Are there socket errors that shouldn't trigger a disconnect? If no, then this change is just fine.

Can you also add a changelog entry to CHANGES.rst? It should be under a new section for a 0.0.1 bump.

@strictlymike
Copy link
Contributor Author

It's not clear to me from the documentation, but in the interest of handling the most narrow case possible to avoid masking errors, I've added a check for the specific case of the broken pipe. And I've updated CHANGES.rst. I tested with the following:

srv = IRCServer(('127.0.0.1', 6667), IRCClient)
srv.serve_forever()

And it worked with my misbehaving client that calls srv.ping() and immediately hangs up.

Let me know if you see anything else needing attention. Thanks!

@jaraco
Copy link
Owner

jaraco commented Nov 15, 2016

As the continuous integration tests have caught, this introduces a SyntaxError on Python 3 - just needs except as.

@strictlymike
Copy link
Contributor Author

Thanks, sorry about that! Updated, retested, and retesting locally with python3 for good measure before I push again.

@jaraco
Copy link
Owner

jaraco commented Nov 15, 2016

Looks great. And I can cut a release with a simple tag.

@jaraco jaraco merged commit f44460b into jaraco:master Nov 15, 2016
@strictlymike strictlymike deleted the issue-119 branch November 15, 2016 17:40
@strictlymike
Copy link
Contributor Author

Rock_on. Thanks!

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.

None yet

2 participants