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


Groups > comp.lang.python > #18422

Re: Avoid race condition with Popen.send_signal

Date 2012-01-03 18:25 +0100
From Jérôme <jerome@jolimont.fr>
Subject Re: Avoid race condition with Popen.send_signal
References (3 earlier) <20120103094415.072db024@bouzin.lan> <CAPTjJmqnzpLw8qHWkPQmcX=At0-OpPy1up0wBBfp3eLPrhKoFg@mail.gmail.com> <mailman.4342.1325583331.27778.python-list@python.org> <f677dfce-e286-4366-ba64-3585dc6428c7@p4g2000vbt.googlegroups.com> <20120103172444.3d56ebf4@bouzin.lan>
Newsgroups comp.lang.python
Message-ID <mailman.4358.1325611385.27778.python-list@python.org> (permalink)

Show all headers | View raw


Tue, 3 Jan 2012 17:24:44 +0100
Jérôme a écrit:

> > Too many libraries do too many questionable things with signal handlers
> > so I find it much safer and easier just to avoid the damn things whenever
> > possible.
> 
> My small program _seems to_ work with the dirty hacks I already exposed.
> Yet, I'd rather stay on the safe and easy side, especially in a future
> bigger program. Therefore, I'm still interested in a better way to proceed.
> 
> Is there another way to tell beep (or sox) to stop before the end of the
> beep ?
> 
> AFAIK, the only way to stop it on console is to feed it Ctrl+C. Should I use
> communicate() for that ? How ? Apparently, the following does not work :
> 
> 	process.communicate("\C-c")
> 

I've been reading more and what I wrote now appears to me as silly, as
Ctrl+C, as I understand, is just a way to send SIGINT...

I guess I'll have to do with the signal handling, then.

But I think I'm beggining to understand what you (Adam Skutt) meant. This is
just as dirty as using Ctrl+C to stop beep when using the console, as opposed
to using a software that would wait for a specific keypress to stop (in which
case I could use communicate()).

-- 
Jérôme

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


Thread

Re: Avoid race condition with Popen.send_signal Cameron Simpson <cs@zip.com.au> - 2012-01-03 12:44 +1100
  Re: Avoid race condition with Popen.send_signal Adam Skutt <askutt@gmail.com> - 2012-01-02 19:16 -0800
    Re: Avoid race condition with Popen.send_signal Cameron Simpson <cs@zip.com.au> - 2012-01-03 15:53 +1100
      Re: Avoid race condition with Popen.send_signal Adam Skutt <askutt@gmail.com> - 2012-01-03 06:52 -0800
    Re: Avoid race condition with Popen.send_signal Jérôme <jerome@jolimont.fr> - 2012-01-03 09:44 +0100
      Re: Avoid race condition with Popen.send_signal Adam Skutt <askutt@gmail.com> - 2012-01-03 06:12 -0800
        Re: Avoid race condition with Popen.send_signal Jérôme <jerome@jolimont.fr> - 2012-01-03 16:09 +0100
          Re: Avoid race condition with Popen.send_signal Adam Skutt <askutt@gmail.com> - 2012-01-03 09:58 -0800
            Re: Avoid race condition with Popen.send_signal Jérôme <jerome@jolimont.fr> - 2012-01-03 19:45 +0100
    Re: Avoid race condition with Popen.send_signal Chris Angelico <rosuav@gmail.com> - 2012-01-03 19:58 +1100
      Re: Avoid race condition with Popen.send_signal Adam Skutt <askutt@gmail.com> - 2012-01-03 06:20 -0800
    Re: Avoid race condition with Popen.send_signal Jérôme <jerome@jolimont.fr> - 2012-01-03 10:38 +0100
      Re: Avoid race condition with Popen.send_signal Adam Skutt <askutt@gmail.com> - 2012-01-03 07:03 -0800
        Re: Avoid race condition with Popen.send_signal Jérôme <jerome@jolimont.fr> - 2012-01-03 17:24 +0100
        Re: Avoid race condition with Popen.send_signal Jérôme <jerome@jolimont.fr> - 2012-01-03 18:25 +0100

csiph-web