[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-30 Thread Todd Rovito
Change by Todd Rovito : -- nosy: +Todd.Rovito ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-30 Thread Adam Mitchell
Adam Mitchell added the comment: I submitted a pull request, #4181, to fix this issue. I am now waiting for my contributor agreement to be approved. -- nosy: +AdamMitchell ___ Python tracker

[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-30 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +4152 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-lis

[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Lisa, would you care to wrap this one up? -- assignee: docs@python -> lisroach nosy: +lisroach, rhettinger ___ Python tracker ___ _

[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-17 Thread R. David Murray
R. David Murray 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,

[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-17 Thread R. David Murray
R. David Murray added the comment: I think in the echo examples the 'with conn' block should be indented and a 'with s:' added around it. The network sniffer should probably use a with statement with the created socket. The CAN example ends only on ctrl-C, and could go into a fast spin loop on

[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-17 Thread Nathaniel Manista
Nathaniel Manista added the comment: As I am learning from the examples, I don't have the confidence to propose a fix to them. :-P For the IPv4-and-IPv6 "Echo server program": should s be closed at some point after "conn, addr = s.accept()"? Should s be closed on the line immediately after "

[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-09 Thread R. David Murray
R. David Murray added the comment: Which example? (It might be easiest to just generate a PR with your suggested improvement.) -- nosy: +r.david.murray ___ Python tracker ___

[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-09 Thread Nathaniel Manista
New submission from Nathaniel Manista : https://docs.python.org/3.7/library/socket.html#socket.socket.close says "it is recommended to close() [sockets] explicitly, or to use a with statement around them", but in the example code on the same page at https://docs.python.org/3.7/library/socket.h