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

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <jerome@jolimont.fr>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.091
X-Spam-Evidence '*H*': 0.82; '*S*': 0.00; 'handlers': 0.09; 'handling,': 0.09; 'ctrl+c': 0.16; 'hacks': 0.16; 'header:X-Face:1': 0.16; 'received:lan': 0.16; 'cc:addr:python- list': 0.16; 'jan': 0.19; 'appears': 0.19; 'cc:no real name:2**0': 0.20; '(or': 0.22; 'wrote': 0.22; 'header:In-Reply-To:1': 0.22; 'cc:2**0': 0.24; 'libraries': 0.24; 'guess': 0.26; '(in': 0.26; "i'm": 0.26; 'cc:addr:python.org': 0.29; "i've": 0.31; "i'll": 0.31; 'does': 0.32; '+0100': 0.32; 'tue,': 0.32; 'rather': 0.33; 'there': 0.33; 'too': 0.34; 'things': 0.34; 'then.': 0.34; 'yet,': 0.34; 'especially': 0.35; 'subject:with': 0.36; 'bigger': 0.37; 'opposed': 0.37; 'but': 0.37; 'another': 0.37; 'think': 0.37; 'could': 0.37; 'using': 0.38; 'signal': 0.38; 'easier': 0.38; 'feed': 0.39; 'possible.': 0.39; "i'd": 0.39; 'should': 0.39; 'more': 0.61; 'stop': 0.63; 'received:89': 0.64; 'therefore,': 0.66; '2012': 0.67; 'safe': 0.70; 'console,': 0.84; 'exposed.': 0.84; 'to:none': 0.93; 'safer': 0.95
X-Spam-Checker-Version SpamAssassin 3.3.1 (2010-03-16) on jeftof
X-Spam-Level
X-Spam-Status No, score=0.2 required=7.0 tests=ALL_TRUSTED,MISSING_HEADERS autolearn=no version=3.3.1
Date Tue, 3 Jan 2012 18:25:46 +0100
From Jérôme <jerome@jolimont.fr>
Cc python-list@python.org
Subject Re: Avoid race condition with Popen.send_signal
In-Reply-To <20120103172444.3d56ebf4@bouzin.lan>
References <CABicbJKPmckzRwKa9BgTzP8p+nVO98eKh2s1=ZDjBSoY-N1OvQ@mail.gmail.com> <mailman.4327.1325555666.27778.python-list@python.org> <63817f2b-ccf8-4d7d-92a6-c1d622986d8a@j10g2000vbe.googlegroups.com> <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>
X-Mailer Claws Mail 3.7.10 (GTK+ 2.24.8; x86_64-pc-linux-gnu)
X-Face "kBB1-!wF@,"j_&tJ&7; T,t)PeQkZg5?.:{p,s>/,+?b6pN5!yxZy^nRXA=*?W+|J9OG!W[rdx^VA^Sx`R"g,; +MzhAq"tZFg27W4qX+ZXvLX=%piZ6c.7@oSDHyQ0Mff#HGx<{
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4358.1325611385.27778.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325611385 news.xs4all.nl 6966 [2001:888:2000:d::a6]:38937
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18422

Show key headers only | 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