Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: INADA Naoki Newsgroups: comp.lang.python Subject: Re: Other difference with Perl: Python scripts in a pipe Date: Fri, 11 Mar 2016 09:08:55 +0900 Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de iqp1fIgVi5iphUoS5o2aZA9sbJ04b2mvmn4gs+5ywdiQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'exception.': 0.07; 'cc:addr:python-list': 0.09; 'python': 0.10; 'explicitly': 0.15; '2016': 0.16; 'email addr:hotmail.com>': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'swallow': 0.16; 'usually.': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; 'try:': 0.18; '>': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'pass': 0.22; 'am,': 0.23; 'errors': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'url:bugs': 0.24; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'command-line': 0.29; 'received:209.85.213.174': 0.29; 'silence': 0.29; 'raise': 0.29; "i'm": 0.30; 'probably': 0.31; 'changed': 0.33; 'url:python': 0.33; 'except': 0.34; 'received:google.com': 0.35; 'skip:p 30': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'possible': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'seem': 0.37; 'received:209': 0.38; 'sure': 0.39; 'does': 0.39; 'subject:with': 0.40; 'behavior': 0.61; 'no.': 0.62; 'mar': 0.65; 'worth': 0.67; 'zen': 0.84; 'hassle': 0.91; 'interesting,': 0.93; 'to:addr:hotmail.com': 0.98 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 :cc; bh=XFhzlniFotLAcMBRAWE5FNkYF+V/0yhWiq47tlWn5EU=; b=ewfj2/T4r7z0HM01yAd1cXahtURkMoIMW1XaoRTKC+zdylIhmw9qSFgD14WNQtaedT U/KbCr7C4BrWqjYCna/ssDJKYRe3/j+dSq3TzyKGer3YRTydeuTYDt5gYDuZaDKrrkBA 1lNH6+QZpDhhEGAOK/UzqEo99wASu4QB0+5G8DCOGZGBl/1jpk/RWBfTAygnhD7HJDqT ZBI8liYYMK3MVIH7brTFIG0KDuc91Xy0GyISjIHBUAJVkaBTBHsfEwX7b253vlnfwMzZ 1gFXtmoHL0DrWKoo11ekGfjjZooM/haJ8533jyqbPySdNEAGdSIZyKksb7Myjq52mOsB +xUw== 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:from:date :message-id:subject:to:cc; bh=XFhzlniFotLAcMBRAWE5FNkYF+V/0yhWiq47tlWn5EU=; b=VmQcz7ONNATyGwMfaoZ8RDDJwIlytZv8wuu3webLyXA/L8HMhjWjofKPHdfuLa8qRX 0BlGW6BBq26d2C6K23YCx3Xwr3NzQ9+pNcwuraTUuZDKly/zh80Aaweg32qvSvcutvJW XiE/+cr3O4bG9MfLBscxcU41+2rCNiu3eTphJmxiMv4imoGTvYnNFjF9vNJ+eSWQWW3Z DmDmcU+uXHIIPf+hUIITLs9bcvWKgNOHdjcYkxOOQX7hRwJvWHhtjSrJ2ZAJhBJPhBFH qLDJqLvxEZpMAkac7xtDfmz/5DokLkk8ByHGLh4IioqnMhp9/iOZL8yWqzpEPJskoDAW wNmQ== X-Gm-Message-State: AD7BkJKNhWr065s0oS/1QjgyJzgvvYqsxCBDq7XJhZF6nM//Z0/iL44vuJz5bzN56xzD5RxxPbos3lZn3OxPoA== X-Received: by 10.50.66.179 with SMTP id g19mr69911igt.4.1457654955317; Thu, 10 Mar 2016 16:09:15 -0800 (PST) In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 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:104565 On Fri, Mar 11, 2016 at 8:48 AM, Fillmore wrote: > On 3/10/2016 5:16 PM, Ian Kelly wrote: > >> >> Interesting, both of these are probably worth bringing up as issues on >> the bugs.python.org tracker. I'm not sure that the behavior should be >> changed (if we get an error, we shouldn't just swallow it) but it does >> seem like a significant hassle for writing command-line >> text-processing tools. >> > > is it possible that I am the first one encountering this kind of issues? > > No. I see it usually. Python's zen says: > Errors should never pass silently. > Unless explicitly silenced. When failed to write to stdout, Python should raise Exception. You can silence explicitly when it's safe: try: print(...) except BrokenPipeError: os.exit(0)