[issue10739] Subprocess behavior on Windows
New submission from Ross Lagerwall <rosslagerwall@gmail.com>: On Windows, creating a subprocess does not work when stdin (or stdout or stderr) is set as a file object created from socket.makefile(). An IOError is thrown. This works fine on Unix so I assume it is a platform limitation rather than a Python bug. If this is so then this should be documented under the subprocess module. ---------- assignee: docs@python components: Documentation, Library (Lib) files: test.py messages: 124382 nosy: docs@python, rosslagerwall priority: normal severity: normal status: open title: Subprocess behavior on Windows type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file20115/test.py _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10739> _______________________________________
Ross Lagerwall <rosslagerwall@gmail.com> added the comment: Attached is a patch to document this. ---------- keywords: +patch Added file: http://bugs.python.org/file20116/subprocessdoc.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10739> _______________________________________
R. David Murray <rdmurray@bitdance.com> added the comment: This might be an example of the general problem that on windows, sockets and files don't mix well. You can't use a file in a select call, either. I think there are two possibilities here: either makefile doesn't produce anything very useful on windows, or there's a bug in either makefile or subprocess. If the former, the proper place to document it would be in the makefile docs. ---------- assignee: docs@python -> nosy: +brian.curtin, gregory.p.smith, r.david.murray, tim.golden versions: +Python 3.1 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10739> _______________________________________
Ross Lagerwall <rosslagerwall@gmail.com> added the comment: Since the code in subprocess gets the underlying fileno of the file-like object (line 819 of subprocess.py), I presume it is an example of the general problem of files and sockets not mixing very well on Windows. So, I have attached a patch to document this in socket.makefile(). However, I also see that *it* is documented in select.select() that it will not work with Windows file-like objects. Maybe there should still be a note in subprocess.Popen() as per the first patch? ---------- Added file: http://bugs.python.org/file20117/socketdoc.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10739> _______________________________________
R. David Murray <rdmurray@bitdance.com> added the comment: I think I'll leave that decision up to the doc crew. My thought was that makefile was supposedly returning a file, therefore it was appropriate to document there that it wasn't really a file on windows, whereas subprocess docs are only talking about files, and it only just so happens that you can pass it a socket on unix by using makefile. ---------- assignee: -> docs@python stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10739> _______________________________________
Georg Brandl <georg@python.org> added the comment: I agree that this belongs in the makefile docs. Fixed in r87535. ---------- nosy: +georg.brandl resolution: -> fixed status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10739> _______________________________________
participants (3)
-
Georg Brandl
-
R. David Murray
-
Ross Lagerwall