![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
18 Oct
2017
18 Oct
'17
4:12 a.m.
R. David Murray <rdmurray@bitdance.com> added the comment: Heh, of course the socket server also only ends with ctl-C. And I misread the CAN example, it won't spin because the read isn't wrapped in a try/except. So yes, that should use a with on the socket as well, since the with will close the socket on a ctl-C, unlike a close statement after the loop which will never be reached. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue31739> _______________________________________