Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Greg Ewing
Bill Janssen wrote: The HTTP client-side library calls "makefile" on the socket, then closes it, then passes the file returned from "makefile" on to application code to work with. Seems to me we really need two different APIs for doing a makefile()-like operation, depending on whether you're e

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread A.M. Kuchling
On Wed, May 07, 2008 at 03:29:33PM -0300, Facundo Batista wrote: > > This would be a good chance for Py3K to dump httplib/urllib/urllib2 > > and use some more modern library. > > Which modern library do you propose? I have no idea -- presumably we'd need to compare a bunch of them (curl, libwget

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Facundo Batista
2008/5/7, A.M. Kuchling <[EMAIL PROTECTED]>: > This would be a good chance for Py3K to dump httplib/urllib/urllib2 > and use some more modern library. Which modern library do you propose? -- .Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread A.M. Kuchling
On Wed, May 07, 2008 at 10:29:02AM -0700, Bill Janssen wrote: > This particular nasty pattern is deeply entwined in all the code that > touches the HTTP library in any way, so it will be a big job to get > rid of it -- basically re-writing HTTP support and all the services > which use it. I didn't

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Bill Janssen
See http://bugs.python.org/issue1348. Bill ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Bill Janssen
> I would be okay with changing the requirements in Py3k so that you are > required to keep the socket object open at least as long as you plan > on using the derived stream(s), but this will require some careful > redesign, especially in the light of SSL support. (Read ssl.py and > _ssl.c to under

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Guido van Rossum
On Wed, May 7, 2008 at 7:37 AM, Sjoerd Mullender <[EMAIL PROTECTED]> wrote: > On 2008-05-07 13:37, Amaury Forgeot d'Arc wrote: > > > Hello, > > > > 2008/5/7 Sjoerd Mullender <[EMAIL PROTECTED]>: > > > > > Why does sock.close() not actually close sock? > > > > > > If I run the code > > > > > > imp

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Robert Brewer
Sjoerd Mullender wrote: > On 2008-05-07 13:37, Amaury Forgeot d'Arc wrote: > > 2008/5/7 Sjoerd Mullender <[EMAIL PROTECTED]>: > >> I would expect that a system call is done to actually close the > >> socket and free the file descriptor. But that does not happen. > > > > It does close the socket: >

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Sjoerd Mullender
On 2008-05-07 13:37, Amaury Forgeot d'Arc wrote: Hello, 2008/5/7 Sjoerd Mullender <[EMAIL PROTECTED]>: Why does sock.close() not actually close sock? If I run the code import socket sock = socket.socket() ... sock.close() I would expect that a system call is done to actually close the

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Amaury Forgeot d'Arc
Hello, 2008/5/7 Sjoerd Mullender <[EMAIL PROTECTED]>: > Why does sock.close() not actually close sock? > > If I run the code > > import socket > sock = socket.socket() > ... > sock.close() > > I would expect that a system call is done to actually close the socket and > free the file descript

[Python-Dev] sock.close() not closing?

2008-05-07 Thread Sjoerd Mullender
Why does sock.close() not actually close sock? If I run the code import socket sock = socket.socket() ... sock.close() I would expect that a system call is done to actually close the socket and free the file descriptor. But that does not happen. Look at the code in socket.py. It merely rep