Message11883

Author psykiatris
Recipients jeff.allen, mga792, psykiatris
Date 2018-04-07.01:47:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <31a7c26f-996e-746a-f84a-089e97b1c850@gmail.com>
In-reply-to <73e2c8b0-0df2-7ec6-9d77-295d033d6496@gmail.com>
Content
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>
> _______________________________________
Files
File name Uploaded
test_subprocess.py psykiatris, 2018-04-07.01:47:24
unnamed psykiatris, 2018-04-07.01:47:21
History
Date User Action Args
2018-04-07 01:47:25psykiatrissetrecipients: + psykiatris, jeff.allen, mga792
2018-04-07 01:47:25psykiatrislinkissue2664 messages
2018-04-07 01:47:24psykiatriscreate