I was developing a script to demonstrate the subprocess call with a shell and without shell. I got the two processes working as they should. If if the parameters are not passed correctly, it will cause the stdin stream to close.

What I also discovered is that, the communicate call simply communicates with your child process, printing the returned information. While the documentation states you can pass in a string, doing so will cause the stream to close.

return p.communicate() <----- fine

return p.communicate(input)  <-------NOT fine. Maybe because it's trying to put something back in the stream.

Anyway, I'm still looking into this and study the communicate() call more closely.


Attaching test_subprocess.py


On 04/04/2018 06:28 PM, Patrick Palczewski wrote:
Patrick Palczewski <psykiatris@gmail.com> added the comment:

Thanks. I will look at it some more.\\I have a pretty good debugger in 
IntelliJ, and it pointed to the fact that stdin and PIPE were returning 
a -1, so I followed that road.

I agree. More testing with different parameters .  It is noted that 
2.7.2 actually has a clearer error code: it says IOError: Stream closed.

On 04/04/2018 03:14 PM, Jeff Allen wrote:
Jeff Allen <ja.py@farowl.co.uk> added the comment:

tnsping is apparently an Oracle utility http://www.orafaq.com/wiki/Tnsping

_______________________________________
Jython tracker <report@bugs.jython.org>
<http://bugs.jython.org/issue2664>
_______________________________________

--
Patrick Palczewski VRS# 818.208.2344