Python schließt Socket Guter Weg
from contextlib import closing
try:
with closing(sock):
sock.shutdown()
except OSError:
pass
Puzzled Puffin