Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2738

Re: Trapping the segfault of a subprocess.Popen

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Trapping the segfault of a subprocess.Popen
Date 2011-04-06 23:12 -0400
References <5adc9111-e7a5-4486-9809-f6a74f96a965@i14g2000yqe.googlegroups.com> <pan.2011.04.06.23.58.02.172000@nowhere.com>
Newsgroups comp.lang.python
Message-ID <mailman.96.1302145972.9059.python-list@python.org> (permalink)

Show all headers | View raw


On 4/6/2011 7:58 PM, Nobody wrote:
> On Wed, 06 Apr 2011 02:20:22 -0700, Pierre GM wrote:
>
>> I need to run a third-party binary from a python script and retrieve
>> its output (and its error messages). I use something like
>>>>> process = subprocess.Popen(options, stdout=subprocess.PIPE,
>> stderr=subprocess.PIPE)
>>>>> (info_out, info_err) = process.communicate()
>> That works fine, except that the third-party binary in question doesn't
>> behave very nicely and tend to segfaults without returning any error. In
>> that case, `process.communicate` hangs for ever.

I am not sure this will help you now, but....
Victor Stinner has added a new module to Python 3.3 that tries to catch 
segfaults and other fatal signals and produce a traceback before Python 
disappears.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Trapping the segfault of a subprocess.Popen Pierre GM <pierregmcode@gmail.com> - 2011-04-06 02:20 -0700
  Re: Trapping the segfault of a subprocess.Popen Nobody <nobody@nowhere.com> - 2011-04-07 00:58 +0100
    Re: Trapping the segfault of a subprocess.Popen Terry Reedy <tjreedy@udel.edu> - 2011-04-06 23:12 -0400
      Re: Trapping the segfault of a subprocess.Popen Pierre GM <pierregmcode@gmail.com> - 2011-04-07 01:45 -0700
    Re: Trapping the segfault of a subprocess.Popen Pierre GM <pierregmcode@gmail.com> - 2011-04-07 01:44 -0700

csiph-web