On Dec 11, 2007 12:26 AM, Will Maier <[EMAIL PROTECTED]> wrote:
> On Mon, Dec 10, 2007 at 11:59:14PM +0100, Benoit Chesneau wrote:
> > --------------------------------------  start
> > import os, socket
> > from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
> > import threading
> >
> > host = socket.getfqdn('127.0.0.1')
> > port = (os.getpid() % 31000) + 1024
> > server = HTTPServer((host, port), BaseHTTPRequestHandler)
> >
> > print "before:"
> > print server.socket.getsockname()[1]
> > server_thread = threading.Thread(target=server.serve_forever)
> > server_thread.setDaemon(1)
> > server_thread.start()
> >
> > print "after:"
> > print server.socket.getsockname()[]
>
> I assume you mean server.socket.getsockname()[1] here.
>
> > print "ok"
> > -------------------------------------- end of code
> >
> > On 4.2 & -current, if you execute this code you get this result :
> >
> > -------
> > before:
> > <numofport>
> > after:
> > --------
>
> On my i386 box (recentish snap), I can't reproduce the problem. The
> script returns immediately, and before == after.
>
> --
>

On python 2.5 ?
I did new tests this morning and it doesn't work with python 2.5 on
4.2, -current amd64 (last snap) or macppc 4.2. It works on i386
openbsd 4.1 (i've no i386 under open yet).

weird.

- benoîtf

Reply via email to