[Tutor] Running Java process doesn't return to subprocess.call (fwd)

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Wed May 17 01:03:35 CEST 2006


> I actually changed that just before I sent the email to tutor, cause I'd 
> seen a reference on the web about a Java process in Zope hanging. And 
> the fix was to have errfile set to None. It did NOT fix the problem. It 
> actually cause a Java Expection now! :-(

Hi Jerome,

[Please keep tutor at python.org in CC; I'm about to dive into a situation 
(grad school) where I may not be able to answer Tutor mail for a while. 
It's best to keep the discussion within the mailing list.  That way, other 
folks can help too, and we avoid a single-point-of failure: me.  *grin*

As another meta note to the others here on Tutor: since I might be gone 
for a bit, the current plan is to pass the administrative reins to Kent 
Johnson.]


Do you mind if you show the exception traceback to us on the list? 
That's a significant change in behavior, and an unexpected one!  Let's 
look the error there more closely.


> The Java program expect nothing from input. So I'm still stumped on why 
> this is hanging. Is there any insight you have on why a Java process 
> would hang like that? I use the same function in other programs and it 
> works just fine.

Odd.  Does this happen to all Java programs you run through Python's 
subprocess module, or is it exclusive to the program that you are running 
now?

What happens if you do run something silly and simple like:

/*** Java code ***/
public class Test {
     static public void main(String[] args) {
         System.out.println("Hello world");
     }
}
/****************/

For you, does subprocess also freeze here when it tries to drive this Test 
class too?

I have to admit that I'm very ignorant about what's happening here. 
*grin* I think we need to isolate the issue better.  You mentioned that 
subprocess-ing other programs seems fine, so one natural question follows: 
is it Java itself that's doing something funky, or is it something 
particular to the particular Java program we're driving?  Let's do a 
little more work to find what the real issue is.

Best of wishes!


More information about the Tutor mailing list