[ python-Bugs-1681674 ] subprocess.Popen fails with socket._fileobject on Windows

SourceForge.net noreply at sourceforge.net
Thu Mar 15 20:33:08 CET 2007


Bugs item #1681674, was opened at 2007-03-15 20:32
Message generated for change (Comment added) made by htgoebel
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1681674&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Hartmut Goebel (htgoebel)
Assigned to: Nobody/Anonymous (nobody)
Summary: subprocess.Popen fails with socket._fileobject on Windows

Initial Comment:
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.



----------------------------------------------------------------------

>Comment By: Hartmut Goebel (htgoebel)
Date: 2007-03-15 20:33

Message:
Logged In: YES 
user_id=376953
Originator: YES

File Added: tst_subprocess_socket_client.py

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1681674&group_id=5470


More information about the Python-bugs-list mailing list