Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #2497
| References | <dc8e1dcd-303c-4e07-bdda-1b12277976f0@f31g2000pri.googlegroups.com> <mailman.150.1301801357.2990.python-list@python.org> <8d22e277-5f5f-473f-9ddf-21acee876f9a@i4g2000pro.googlegroups.com> |
|---|---|
| Date | 2011-04-02 21:14 -0700 |
| Subject | Re: Get subprocess error output from shell command |
| From | Chris Rebert <clp2@rebertia.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.153.1301804067.2990.python-list@python.org> (permalink) |
<quote what="earlier relevant post" reason="context">
On Sat, Apr 2, 2011 at 8:50 PM, Gnarlodious <gnarlodious@gmail.com> 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,
</quote>
On Sat, Apr 2, 2011 at 9:00 PM, Gnarlodious <gnarlodious@gmail.com> wrote:
> On Apr 2, 9:29 pm, Chris Rebert wrote:
>
>> if proc.returncode: # non-zero exit status, indicating error
>> print("Encountered error:")
>> 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
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Get subprocess error output from shell command Gnarlodious <gnarlodious@gmail.com> - 2011-04-02 20:07 -0700
Re: Get subprocess error output from shell command Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-04-02 23:25 -0400
Re: Get subprocess error output from shell command Gnarlodious <gnarlodious@gmail.com> - 2011-04-02 20:36 -0700
Re: Get subprocess error output from shell command Chris Rebert <clp2@rebertia.com> - 2011-04-02 20:29 -0700
Re: Get subprocess error output from shell command Gnarlodious <gnarlodious@gmail.com> - 2011-04-02 20:50 -0700
Re: Get subprocess error output from shell command Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-04-03 00:03 -0400
Re: Get subprocess error output from shell command Chris Rebert <clp2@rebertia.com> - 2011-04-02 21:10 -0700
Re: Get subprocess error output from shell command Gnarlodious <gnarlodious@gmail.com> - 2011-04-02 21:00 -0700
Re: Get subprocess error output from shell command Chris Rebert <clp2@rebertia.com> - 2011-04-02 21:14 -0700
csiph-web