Kill thread or at least socket.getaddrinfo

Chris Mellon arkanes at
Tue Apr 10 20:20:47 CEST 2007

On 10 Apr 2007 11:07:51 -0700, lobais at <lobais at> wrote:
> On 26 Mar., 18:08, kyoso... at wrote:
> > you know the pid, you can kill it, but that's not always a
> > clean way of accomplishing the task.
> So I have to open the connection in a new process... Sigh.. How I hate
> this part of Python.

This isn't a python problem. You can't cleanly or safely kill threads,
period. If you have to use blocking functions like this (you don't,
you might consider using Twisted for your networking instead) the way
you "cancel" it is to just stop waiting for the response and discard
the response (or error) when it eventually comes.

> --

More information about the Python-list mailing list