Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion creating size-limited tar files

Received: by 10.66.75.164 with SMTP id d4mr706478paw.10.1352877801277;
        Tue, 13 Nov 2012 23:23:21 -0800 (PST)
Path: 6ni79150pbd.1!nntp.google.com!npeer03.iad.highwinds-media.com!feed-me.highwinds-media.com!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!eweka.nl!lightspeed.eweka.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path: <ian.g.ke...@gmail.com>
X-Original-To: python-l...@python.org
Delivered-To: python-l...@mail.python.org
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'objects,': 0.07;
	'__init__': 0.09; 'c2pwrite': 0.09; 'errread,': 0.09; 'file-like':
	0.09; 'instance.': 0.09; 'objects.': 0.09; 'stderr': 0.09;
	'stdout': 0.09; 'subject:files': 0.09; 'errwrite)': 0.16;
	'fileno': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'skip:" 30': 0.20;
	'"",': 0.22; 'work.': 0.23; 'header:In-Reply-To:1': 0.25; '(most':
	0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28;
	'actual': 0.28; 'subject:size': 0.29; 'file': 0.32; 'could': 0.32;
	'traceback': 0.33; 'to:addr:python-list': 0.33;
	'received:google.com': 0.34; 'or,': 0.34; 'nov': 0.35; 'pm,':
	0.35; 'received:209.85': 0.35; 'received:209': 0.37; 'subject:: ':
	0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40;
	'header:Received:5': 0.40; 'think': 0.40; 'to:name:python': 0.84;
	'subject:limited': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:content-type; bh=sau6J+4hTuR+iHdf6EolryATKnLwLs6LxSAwohhk9+8=;
	b=0IctSmqBqmV1ZHv6gzZKyvu42Z396tqWZ27TrglLcC7pfPN44SShm0gWfN53GE3/EC
	U65fo8xOSWU5x4Yx7vUgIrkDL9/mg15nhKqdotbnhnY24BuIDa7TvttJuFGdUxAfeY3g
	jAzvb16M86FYaNVi+ZVzu6lN4ooBZm9JSS3AYoDOEH296oZoCQzFnZyuTJyEKtgrmAan
	AMXVXhHRg3urbHtv/sIQVkvFoX8WZnBHt8GSpZPDH4hujWcj7wkFKUmlFRzpqQIJ7kx0
	VEwkh1yvHAR8KuiQYYyvJLgsi+JC8oBuFnqsanVNxdVBFGkmbvzZl0HEkPyRGfaVzg9r
	N2kQ==
MIME-Version: 1.0
In-Reply-To: <87lie4lnxr....@nitrogen.i-did-not-set--mail-host-address--so-tickle-me>
References: <mailman.3381.1352308430.27098.python-l...@python.org>
	<509ab0fa$0$6636$9b4e6...@newsspool2.arcor-online.net>
	<roy-2C9B4D.15322307112...@news.panix.com>
	<509AD812.2060...@gmail.com>
	<CAHVvXxTH7WrfT41GDj15f9FS4eguBF2dj4Khpu_vw2TWMkv...@mail.gmail.com>
	<CAF_E5JbY71J3ix9PiXu7wvvkzc_aG9ZtdwKkuxXXAU-SFeR...@mail.gmail.com>
	<CAF_E5JYJ7Fw4b4z81454k9HwmjZ49qjx48fC_f+skcphCDN...@mail.gmail.com>
	<CAF_E5Jas3ObdX=Mhusj63R_Xcm0e1JwjPEuOgZoggON6-ct...@mail.gmail.com>
	<CAF_E5JZFJ+TPmF0LUEFU8AVqbOWfJbH9Yy60CKkcrDNnWAT...@mail.gmail.com>
	<CALwzidnrTcSK+Z0cGf5WpTN2sLqVgbpbt2i1DcdUFnGQYEv...@mail.gmail.com>
	<87lie4lnxr....@nitrogen.i-did-not-set--mail-host-address--so-tickle-me>
From: Ian Kelly <ian.g.ke...@gmail.com>
Date: Wed, 14 Nov 2012 00:22:48 -0700
Subject: Re: creating size-limited tar files
To: Python <python-l...@python.org>
X-BeenThere: python-l...@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-requ...@python.org?subject=unsubscribe>
List-Archive: <http://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-l...@python.org>
List-Help: <mailto:python-list-requ...@python.org?subject=help>
List-Subscribe: <http://mail.python.org/mailman/listinfo/python-list>,
	<mailto:python-list-requ...@python.org?subject=subscribe>
Newsgroups: comp.lang.python
Message-ID: <mailman.3672.1352877800.27098.python-l...@python.org>
Lines: 19
NNTP-Posting-Host: 2001:888:2000:d::a6
X-Trace: 1352877800 news.xs4all.nl 6941 [2001:888:2000:d::a6]:57514
X-Complaints-To: ab...@xs4all.nl
X-Received-Bytes: 4500
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Nov 13, 2012 at 11:05 PM, Kushal Kumaran
<kushal.kumaran+pyt...@gmail.com> wrote:
> Or, you could just change the p1's stderr to an io.BytesIO instance.
> Then call p2.communicate *first*.

This doesn't seem to work.

>>> b = io.BytesIO()
>>> p = subprocess.Popen(["ls", "-l"], stdout=b)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.2/subprocess.py", line 711, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "/usr/lib64/python3.2/subprocess.py", line 1112, in _get_handles
    c2pwrite = stdout.fileno()
io.UnsupportedOperation: fileno

I think stdout and stderr need to be actual file objects, not just
file-like objects.