Hi Robert,
I think you are in that netherworld between Jython Python Exceptions and Java Exceptions.  It looks like you've set your Java program to write errors to the new OutputStream, but then you have an unhandled exception 'inside' Jython.
If you run the following Jython script:
print hello
The result is:
NameError: hello
This is written to standard err.
I think python exceptions in the interpreter generate Java PyException and these I beleive are subsets of RuntimeException.  If you wrap your py exec statement inside a Java try catch you should then see the error reported back to Java  in your new output stream and not stderr.




"print hello");


catch(Exception e) {



In trying to help the new socket testing for Jython 2.2, myself and some others were quite confused at times by a similar problem when it was not clear if the error came from Java or Python.  The error handling and reporting  was improved substantially during the testing.  I am assuming that your program printed an error from Python to standard err and then returned to Java.  I don't know if this is how it should work or not.  It is not intuitive to me anyway.  I think there should be better messages when you run without the try catch from Java or Java should force you to use the try catch - a Java Exception rather than a RunTimeException, but I am not a language deigner and do not know what the repurcussions of this would be.
 - Bob