> I have run in to a problem when using Jython. My python code that I want to
> run from Java performs a Subprocess.Popen to start a new process and then
> wants to wait on the stdin, stdout of the process by using select. In Jython
> Popen uses StreamIO to represent the streams, which are not selectable,
> leading to an exception being raised in the select method.
> I have read the information here: http://wiki.python.org/jython/SelectModule
> I understand the problem, but the author of the wiki page has written: “To
> do so for Pipes, which are used for communication with sub-processes, it
> would be necessary to rewrite the jython sub-process creation modules, i.e.
> popen, etc, to create SelectableChannels. Although it should be reasonably
> straightforward to implement this, I have no plans to do this work.”
> Is there a plan to make this change in Jython?
I'm the person who wrote that statement. I haven't changed my position
and am still not planning to do that work.
If someone else wants to take it on, I'm happy to provide advice on
how to go about it.
> I have tried to find some info on how to work around this problem, but have
> come up empty handed. Do any of you have another solution to the problem?
> Is there another way in python to do the same functionality as select does?
The only other way is in threads, i.e. spawn off a new thread for
every subprocess you want to run, and have it do blocking reads on the
P.S. Sorry for the delay in reply, I only noticed this message recently.