While I was scanning through Charles Nutter's blog the other week I read http://blog.headius.com/2013/06/the-pain-of-broken-subprocess.html which documents the brokeness inherent in ProcessBuilder which is probably relevant to jython in that it uses ProcessBuilder in Lib/subprocess.py. I've had a quick look around and can't spot whether or not Charles or anyone else followed through and added an alternative to ProcessBuilder into jnr-posix or some other library. Possibly something to keep an eye on for replacing jython's use of ProcessBuilder.

Cheers
Indra


On 16 May 2014 08:24, Jim Baker <jim.baker@python.org> wrote:
Sounds like a great plan for beta 4!

- Jim


On Thu, May 15, 2014 at 4:48 PM, Pekka Klärck <peke@iki.fi> wrote:
2014-05-12 0:57 GMT+03:00 Michael Büsch <m@bues.ch>:
>
> I'm using latest jython hg sources (2.7).
> My code uses subprocess.Popen() and eventually calls terminate() on the object.
> This fails with the following exception:
>
>> Traceback (most recent call last):
>>   File "/home/mb/develop/git/awlsim/./tests/../awlsimcli", line 424, in <module>
>>     sys.exit(main())
>>   File "/home/mb/develop/git/awlsim/./tests/../awlsimcli", line 420, in main
>>     return runWithServerBackend(inputFile)
>>   File "/home/mb/develop/git/awlsim/./tests/../awlsimcli", line 274, in runWithServerBackend
>>     client.shutdown()
>>   File "/home/mb/develop/git/awlsim/awlsim/coreserver/client.py", line 115, in shutdown
>>     self.serverProcess.terminate()
>>   File "/home/mb/develop/hg/jython/dist/Lib/subprocess.py", line 1399, in terminate
>>     _subprocess.TerminateProcess(self._handle, 1)
>> NameError: global name '_subprocess' is not defined
>
> This looks like a bug in the subprocess module.

Neither 'terminate' nor 'kill' nor 'send_signal' are currently
supported by Jython, and I would assume that possible Popen
configuration parameters added in Python 2.6 or 2.7 aren't supported
either. I have understood that supporting everything CPython does is
problematic due to JVM limitations (e.g. signals aren't officially
supported), but it ought to be possible to implement at least 'kill'
by just terminating the started process via the Java API. With CPython
'terminate' sends SIGTERM signal on posix, so if signals aren't
supported implementing it that way is not possible. Implementing
'terminate' as an alias for 'kill', like CPython does on Windows,
ought to be a good enough workaround.

I would love to see at least 'kill' and 'terminate' included into
Jython 2.7. Anyone interested to work with me getting them
implemented?

Cheers,
    .peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Jython-dev mailing list
Jython-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Jython-dev mailing list
Jython-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev




--
Indra Talip