Re: subprocess.Popen(): terminate() exception

Indra Talip <[email protected]>
Newsgroups gmane.comp.lang.jython.devel
Message-ID <CAE+gEVcjiQFRmO2NrgO77h2UAouAg6wLRyk_WR8=j28sKPWP=g@mail.gmail.com>
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 <[email protected]> wrote:

> Sounds like a great plan for beta 4!
>
> - Jim
>
>
> On Thu, May 15, 2014 at 4:48 PM, Pekka Klärck <[email protected]> wrote:
>
>> 2014-05-12 0:57 GMT+03:00 Michael Büsch <[email protected]>:
>> >
>> > 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
>> [email protected]
>> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jython-dev
>
>


-- 
Indra Talip

------------------------------------------------------------------------------
"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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.