Minimizing Connection reset by peer exceptions

Ben Sizer kylotan at
Thu Oct 20 12:28:04 CEST 2005

mirandacascade at wrote:

> Occasionally (perhaps 5% of the time) the following exception gets
> raised:
> (10054, 'Connection reset by peer')

Generally this just means the connection has closed through some
unusual means, perhaps by being turned off, or a network cable being
unplugged, or a timeout along the way, etc. 5% is a high figure, but
perhaps you connect to hosts that are unreliable for some reason.

You don't have control over this really; just make sure you handle the
exception. Such is life, when dealing with networking.

Ben Sizer

More information about the Python-list mailing list