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: 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: =?UTF-8?B?SsOpcsO0bWU=?= Cc: python-list@python.org Subject: Re: Avoid race condition with Popen.send_signal In-Reply-To: <20120103172444.3d56ebf4@bouzin.lan> References: <63817f2b-ccf8-4d7d-92a6-c1d622986d8a@j10g2000vbe.googlegroups.com> <20120103094415.072db024@bouzin.lan> <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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 Tue, 3 Jan 2012 17:24:44 +0100 J=C3=A9r=C3=B4me a =C3=A9crit: > > 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 whenev= er > > possible. >=20 > 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 procee= d. >=20 > Is there another way to tell beep (or sox) to stop before the end of the > beep ? >=20 > 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 : >=20 > process.communicate("\C-c") >=20 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 oppos= ed to using a software that would wait for a specific keypress to stop (in whi= ch case I could use communicate()). --=20 J=C3=A9r=C3=B4me