Author James.Burgess
Recipients James.Burgess, christian.heimes, htgoebel, zseil
Date 2011-10-29.01:05:01
SpamBayes Score 1.14351e-11
Marked as misclassified No
Message-id <>
"Can't Fix" that is not true. 

I've just fixed this in 2.7 with a trivial change to, I think it'd work in over versions too.

Note that type shenanigans are already in play in _get_handles, it's looking at the types of the parameters being passed in to decide how to get a hold of the "handle". The socket module makes a duck type of the file object. The fileno() method of the socket object returns a handle not a CRT file descriptor. This is exactly the kind of handle that _get_handles() is looking for.

So all that is needed is one more "if" to the sequence of how to get the "handle" which for a socket object would be just stdin.fileno() etc.

I've just tested this in a fairly complicated remote job queuing software (a commercial product) that has the ability to connect the spooler (on one machine) with an arbitrary server machine (linux, osx and now windows) via a socket. The job is launched with subprocess.Popen and sockets are wired into the stdin,stdout and stderr. Works beautifully now.

I've attached a patch file made with:
$ diff -c  >

Apply with:
$ cd  Python-2.7.1/Lib ; patch -p0 < c:/temp/

- James
Date User Action Args
2011-10-29 01:05:03James.Burgesssetrecipients: + James.Burgess, htgoebel, zseil, christian.heimes
2011-10-29 01:05:03James.Burgesssetmessageid: <>
2011-10-29 01:05:02James.Burgesslinkissue1681674 messages
2011-10-29 01:05:02James.Burgesscreate