Author htgoebel
Recipients
Date 2007-03-15.19:32:40
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
When using a socket._fileobject as stdin or stdout, subprocess.Popen fails:

Traceback (most recent call last):
...
  File "c:\Python25\lib\subprocess.py", line 586, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "c:\Python25\lib\subprocess.py", line 680, in _get_handles
    p2cread = msvcrt.get_osfhandle(stdin.fileno())
IOError: [Errno 9] Bad file descriptor


Enclose are a _simple_ TCPSocket-Server using subprocess.Popen for echoing some text to the socket. On Linux this works, on Windows this fails with the above traceback.

Usage:
1) In one shell start tst_subprocess_socket.py
2) In a second shell start tst_subprocess_socket_client.py
3) On Window, the server will fail and produce the obove traceback.

History
Date User Action Args
2007-08-23 14:52:30adminlinkissue1681674 messages
2007-08-23 14:52:30admincreate