Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'see:': 0.07; '>>>>': 0.09; 'tuple': 0.09; 'pm,': 0.11; 'output': 0.12; 'subject:error': 0.12; 'wrote:': 0.14; '*nix': 0.16; "b'')": 0.16; 'instantiate': 0.16; 'outputs': 0.16; 'rebert': 0.16; 'stderr': 0.16; 'subject:command': 0.16; 'subject:subprocess': 0.16; 'permission': 0.16; 'url:blog': 0.18; 'object,': 0.19; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'cheers,': 0.20; 'seems': 0.21; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'indicating': 0.23; 'received:209.85.214.174': 0.23; 'received :mail-iw0-f174.google.com': 0.23; 'skip:( 30': 0.24; 'chris': 0.27; 'message-id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'string': 0.29; 'error': 0.29; 'sat,': 0.29; 'exit': 0.29; 'cc:addr:python.org': 0.31; 'however,': 0.31; 'communicate': 0.35; 'conventions': 0.35; 'status,': 0.35; 'rather': 0.36; 'message,': 0.37; 'received:209.85': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'received:209.85.214': 0.39; 'received:209': 0.39; 'empty': 0.40; 'would': 0.40; 'header:Received:5': 0.40; '2011': 0.62; 'here': 0.65; 'response.': 0.67; 'subject:Get': 0.74; '9:00': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WgLwmPMeJIw1WNdaDdF9Kji20HG/A4fBwRxcS8x2C80=; b=DK09v4YMu7uBvyxJrhxx1ppbIOG4c7GuiShj0L+scZ/keT+xxOo3vWYCLSQCy/zoVL nJ1xN0HpcUc+sKe71wiki7NkbZmf29apVoK3tdYj4LpkoHp5wKfIT0AXFieI3ivF/2HB PW9TdVXpirzSZXhpBwm5zIbA4HweZb/KMXX1A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=MkYR08X4NbkkVE1AvkrA5d1NEcBQXypTikC6SPQH6dioggIZSR6Wykd8Alfp53YzTo CeM+lx4WgkXRgur+2YpBt5zk3NZJkGkhnN4PMs40h4lV+y6+sv4QMMk5iqT1aM1q9n0l GWtsEtnFDf34Fesc885s2I+sxR/xbB7xW62Vw= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: <8d22e277-5f5f-473f-9ddf-21acee876f9a@i4g2000pro.googlegroups.com> References: <8d22e277-5f5f-473f-9ddf-21acee876f9a@i4g2000pro.googlegroups.com> Date: Sat, 2 Apr 2011 21:14:25 -0700 X-Google-Sender-Auth: hHmepbYux9_xdx_MkhmZl6bR-zA Subject: Re: Get subprocess error output from shell command From: Chris Rebert To: Gnarlodious Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 30 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1301804067 news.xs4all.nl 41113 [::ffff:82.94.164.166]:44667 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2497 On Sat, Apr 2, 2011 at 8:50 PM, Gnarlodious wrote: > I get it, you instantiate an object, call a method and get a tuple in > response. However, here is what I see: > >>>> process.communicate() > (b'~/Library/Preferences/iCab/iCab 4 Bookmarks: Permission denied\n', > b'') > > So all I get is the string and no error message, On Sat, Apr 2, 2011 at 9:00 PM, Gnarlodious wrote: > On Apr 2, 9:29=C2=A0pm, Chris Rebert wrote: > >> if proc.returncode: # non-zero exit status, indicating error >> =C2=A0 =C2=A0 print("Encountered error:") >> =C2=A0 =C2=A0 print(error_output) # output the error message >> > > Like in my previous post, this only outputs an empty string. > Apparently plutil doesn't communicate well. Yes, it seems to output its error message to stdout, rather than stderr in line with *nix conventions as one would expect. Cheers, Chris -- http://blog.rebertia.com