[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

Kyle Stanley report at bugs.python.org
Thu Dec 12 02:09:15 EST 2019


Kyle Stanley <aeros167 at gmail.com> added the comment:

> One more resource warning about unclosed resource being garbage collected. As per the other tests I think transport and protocol need to be closed as per below patch but someone can verify if it's the right approach.

Ah, good catch. It's not needed when the ValueError occurs because it prevents the transport and protocol from being created in the first place, but I forgot that it would still be needed for the DeprecationWarning test. In addition to your changes, I'll also add a self.assertEqual('CLOSED', protocol.state). This is done in most of the other tests and it doesn't hurt to make sure the protocol properly closed.

I'll add your fix to the PR and add you to the "Co-authored-by" for that commit, thanks.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37228>
_______________________________________


More information about the Python-bugs-list mailing list