Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: nosepipe error Date: Wed, 24 Feb 2016 05:42:15 +1100 Lines: 23 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de wFLMO5zT3VHyHBMV5y4sdQ//yTBRkfsHY+nTmU4k+QXQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'aggregate': 0.07; 'cc:addr :python-list': 0.09; 'chunks': 0.09; 'failure.': 0.09; 'ignoring': 0.09; 'stdout': 0.09; 'thread': 0.10; 'subject:error': 0.11; 'output': 0.13; 'wed,': 0.15; '2016': 0.16; '24,': 0.16; 'cc:name:python list': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'socketpair': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; 'tests': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'prevent': 0.20; 'am,': 0.23; 'feb': 0.23; 'split': 0.23; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; 'attempting': 0.29; 'dan': 0.29; 'far,': 0.29; 'socket,': 0.29; 'code:': 0.29; "i'm": 0.30; 'that.': 0.30; 'another': 0.32; 'problem': 0.33; 'machine.': 0.33; 'received:google.com': 0.35; 'replace': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'test': 0.39; 'sure': 0.39; "you'll": 0.61; 'skip:u 10': 0.61; 'great': 0.63; 'sounds': 0.76; 'chrisa': 0.84; 'seeing,': 0.84; 'streams': 0.84; 'to:none': 0.91; 'writing,': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=gy5dluWaI43CfwiMl8uyXRsr0JsQBElhZ2RwvU8Niu4=; b=Ydl2LS3cr88OGrj6uZZ32totTpUgySrAq7p7r8MZQOtnEz5NlmDl3zg48/To0M8IFN bbHbF+SyDRWtWkwBHXeTQB70S/qmB2OBduoSMXHMFxVq7RUpOOlxzCUtE+WlA+rAoTyu IR3A0tuSld35htwVA/on7+QWoEHRbGiAuCRAnoTH4SapqquDF1POf8rzOyThS4zn6e9R juDzBecBlmYltFRcnOz/uX42Fgf0fOGTH1MN7fViya0YVBR5JGR2SGPfZF0NCv88sZwK rm1UtxRu4K7xuCGbcSBp1G7i7aXYn24wwNDgqLWPc/CoF0ms8GZuq+1I4lNRdI/1dTJJ njFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=gy5dluWaI43CfwiMl8uyXRsr0JsQBElhZ2RwvU8Niu4=; b=nLziHQWXpFDQNjjIIkLXZ6uF/sn1jMYTFpsjhkqmpN9AR2hUYCWpwhPCR4ZlHIp+tY glhFv0VxW/kAVBKRHTpgmOSMHqDs0dC06kXUUl4LyYldG1e5r/WanweoGFoADzRn7Ivs 9tZbG2a5XlufzY3c6XXkAQ8l6OKDXg7p8OZLuOMur2O7JqyDIYbdnGL3Nb5AIP5OqL0G TtS9NEGsLY5rgVt40Je618TiQB3nsoW3sCwyj7WSg/4Dws9mPd+TA3ntFkfbsAA6m1lk aUrtEBu8MKX26VoPDGvUdx2aG4erMRaz4pvVbrcyFM8Ai14PFiMP833oKpb/DoRNVWgH 2Dmw== X-Gm-Message-State: AG10YOR1bFT3fYRBKmgTgHj6NM5a7V5BD0TXrOP+dLm6jmBIsRG6LgGg1qQcIPNoxj9doL2Xp7ThbL1XjpwTaw== X-Received: by 10.50.57.11 with SMTP id e11mr18698638igq.13.1456252935278; Tue, 23 Feb 2016 10:42:15 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103413 On Wed, Feb 24, 2016 at 5:11 AM, Dan Stromberg wrote: > I'm seeing, in the nosepipe code: > # we use stdout for IPC, so block all other output > self._stream = sys.__stdout__ > > I'm not sure using stdout/stdin for IPC is a great thing; a lot of > tests write to stdout or stderr, whether intentionally or > unintentionally. Using standard streams for IPC is well recognized. If it's known in advance, it shouldn't be a problem - writing to stdout/stderr would simply result in a test failure. > I'm attempting to replace the use of stdout/stdin with os.pipe(), but > so far I'm not having much luck. I get three write()'s, and then a > hang. So far, I'm ignoring the fact that os.read() and os.write() > might split or aggregate chunks over a socket, since this is a > socketpair communicating on the same machine. Sounds like the buffer's full. You'll need to have another thread reading before you start writing, to prevent that. ChrisA