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


Groups > comp.lang.python > #53254

Re: subprocess.Popen instance hangs

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <thudfoo@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.096
X-Spam-Evidence '*H*': 0.81; '*S*': 0.00; 'output': 0.05; 'subject:skip:s 10': 0.07; 'subject:instance': 0.09; 'python': 0.11; 'argument,': 0.16; 'googled': 0.16; 'wrote:': 0.18; 'header :User-Agent:1': 0.23; 'sort': 0.25; "i've": 0.25; 'header:In- Reply-To:1': 0.27; 'tim': 0.29; "i'm": 0.30; 'code': 0.31; 'follows': 0.31; 'option.': 0.31; 'skip:s 70': 0.31; 'option': 0.32; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'found.': 0.36; 'done': 0.36; 'should': 0.36; 'message- id:@gmail.com': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'little': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'august': 0.61; 'content-disposition:inline': 0.62; 'header:Message-Id:1': 0.63; 'managing': 0.66; 'brain': 0.68; 'surprise': 0.74; 'topic,': 0.81; '2.7.1': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :message-id; bh=lKAE520sglgAWI61ZQ+U8k2Ae5En/uYa2b3/AGG+vhM=; b=DPQiUDzWSxDNhVTo+TwwwDnI2GCSgNJFVXZZ8wtqoDLwTbMWQ+7+PnYkuLEcY22z98 YvpJu3HQvoSoJQ6u7Em65L0nvWwwvC/IpZXVT7LBlPSzfgC3KMhkLDVB3gdc0l8cmtxI HcWThTscoXm3QsS6Ls9EeU76grLsQ332d53xPvvMI/xi1keIi92ccpT/xiAlrarRAZM5 ANgCaGQuvHGCrfjPg/m5S5v+PKQu7ORSLpU7+d+QcmFltu37A2ubvt7XMvghkMcyPSMd frVnkzFNdZhZpHekD3Ks3H8L91N3xRVZeyIXAexSgeNhNXiajnGHNF+C84bnazQ6layf 3wXQ==
X-Received by 10.66.158.196 with SMTP id ww4mr6551679pab.57.1377808001185; Thu, 29 Aug 2013 13:26:41 -0700 (PDT)
From xDog Walker <thudfoo@gmail.com>
To Python ML <python-list@python.org>
Subject Re: subprocess.Popen instance hangs
Date Thu, 29 Aug 2013 13:26:24 -0700
User-Agent KMail/1.9.5
References <20130829183418.GE414@mail.akwebsoft.com>
In-Reply-To <20130829183418.GE414@mail.akwebsoft.com>
MIME-Version 1.0
Content-Type text/plain; charset="iso-8859-1"
Content-Transfer-Encoding 7bit
Content-Disposition inline
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.370.1377808009.19984.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1377808009 news.xs4all.nl 15929 [2001:888:2000:d::a6]:52477
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:53254

Show key headers only | View raw


On Thursday 2013 August 29 11:34, Tim Johnson wrote:
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
>
> The process has a '--verbose' option. When that option is passed as
> part of the initializer `args' argument, the process will hang.
>
> It should be no surprise as drush output with the --verbose option
> can be _extremely_ verbose, and I can do without it, but I would
> like to learn how to handle it. I've googled this topic, but my poor
> little brain is yet to sort out all of the content found.
>
> ## my relevant code follows :
> p = subprocess.Popen(args,stderr=subprocess.STDOUT,stdout=subprocess.PIPE)
> ## wait() is 'forever' if '--verbose' used
> exit_status = p.wait()
> output = p.stdout.read()
> ## done

p = subprocess.Popen(args,stderr=subprocess.STDOUT,stdout=subprocess.PIPE)
for line in p.stdout:
    do_something(line)
p.wait()

-- 
Yonder nor sorghum stenches shut ladle gulls stopper torque wet 
strainers.

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


Thread

Re: subprocess.Popen instance hangs xDog Walker <thudfoo@gmail.com> - 2013-08-29 13:26 -0700

csiph-web