Re: zope-tests - FAILED: 21, OK: 19

Marius Gedminas <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <20120908112936.GA19052@platonas>
On Fri, Sep 07, 2012 at 01:27:38PM -0400, Tres Seaver wrote:
> On 09/06/2012 03:08 PM, Stefan H. Holek wrote:
> > On 06.09.2012, at 10:58, Marius Gedminas wrote:
> > 
> >> How do you redirect the stderr of a process spawned with 
> >> suprocess.Popen(shell=False) to /dev/null in a cross-platform
> >> manner?
> > 
> > os.devnull perhaps? Or rather, what about subprocess.Popen(cmd,
> > stderr=subprocess.PIPE)?

os.devnull was what I was looking for.

subprocess.Popen(stderr=subprocess.PIPE) was what I went with when I
didn't find os.devnull in time.

> subprocess.PIPE is no good -- it sets up stderr to be read from the
> parent process.  If enough stuff gets written without the parent reading,
> the child will block.

I believe subprocess.Popen.communicate() takes care of that.

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
signature.asc (application/pgp-signature, 190 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iD8DBQFQSywckVdEXeem148RAhvHAJ9IUJd5aS1VCpXg1KldZJhh4BE6QgCfRfWy
reZ954xLZmY1a7sZMjQHsqs=
=k1pG
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.