Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Jim Dodgen Newsgroups: comp.lang.python Subject: Re: redirecting stdout and stderr to /dev/null Date: Sat, 7 May 2016 17:18:09 -0700 Lines: 35 Sender: jim.dodgen@gmail.com Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 9IaRusavrSnPaMBmS5rn/AVTp3Jhf3W5rS6zFtM0mO3A== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'observation': 0.09; 'python': 0.10; 'programs.': 0.11; '2016': 0.16; 'from:addr:jim': 0.16; 'invoking': 0.16; 'learns': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:dev': 0.16; 'subprocess': 0.16; 'useless.': 0.16; 'wrote:': 0.16; 'sender:addr:gmail.com': 0.18; '>': 0.18; 'email addr:gmail.com>': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'exec': 0.22; 'explicit': 0.22; 'am,': 0.23; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'jim': 0.27; 'message-id:@mail.gmail.com': 0.27; 'fine': 0.28; 'looks': 0.29; 'equivalent.': 0.29; 'finds': 0.29; 'fork': 0.29; 'subject:/': 0.30; 'that.': 0.30; 'url:mailman': 0.30; 'strongly': 0.30; 'url:python': 0.33; 'common': 0.33; 'url:listinfo': 0.34; 'received:google.com': 0.35; 'platforms,': 0.35; 'but': 0.36; 'needed': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'received:209.85.213': 0.37; 'things': 0.38; 'version': 0.38; 'received:209': 0.38; 'url:mail': 0.40; 'provide': 0.61; 'fact,': 0.67; 'repeat': 0.67; 'chrisa': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=0iPYlUMFJnB0I59hRaJL5Y+8uZSIysbjMJ81eaIvKpo=; b=hwRuPoEXo/IuyVLX1bVkCViuBEgzYxdMkk/nRyQJajcC2bNVo7/Ey7l1PIVh+NkVK7 M5hxUnZD3HbMOdvN91Y3/pLwR1OHaRzCM+DPXU0us9VKfUX+ZZUnFBEuySwi5MmTEiqS jtYUOUzzQ1+04EUfX0xoPMFd6po/foyHhvnp6PDIgKSCLQzwGHKoiXusDnUGyLN3Vh7v wYoi0AyTTyv7EY1gM/4eKpX7MxK5JHUaSCjjnRwwzPT7YK7oZ9eBIdpTXQLDfdHB1jp3 ApPfAhTc5dNC/LN/qC5tPC/u1LcZfXQwh31HVY18JC2UDyiYEyM780KHRdunbxWcUM1a cV+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=0iPYlUMFJnB0I59hRaJL5Y+8uZSIysbjMJ81eaIvKpo=; b=dufmJzFbsEHsZHuiBJqq2+/++0GU847sEbskAaIIZzr1BOAqhD75vLxlN3fr0+ijrc Ad0UyMGjLqkHpFXD6zmDmD8pjzgW6K7tFJC9TbIzUPBhD0h5qeaktokY2foKZpUZShtq BsSbWdtSN+vZCo1o678Cn/k1OJyYtvf5iObbS/472vt5IF9pfyGpRHbPx+kBRgSsMMp/ DW8XJHYP1FzGVSl31wywFxrQBihIDoO5wERKnxV/BxN8cDXXw+kMlJdH0KOlhWE1PYlm +9WfgH/TL1wAxI9ttkwpTEuH2KFcKEE9gbMO95D8nL5UEGsA5lUD983l15sHw2uVaJeX YMHQ== X-Gm-Message-State: AOPr4FUug0IR7lLztp9krhNmipPVEl8cdCS9ElylikPUc4Z4cyl95QFiqqScQzbQA0tY7ZKWNeZPtYDNijcq4Q== X-Received: by 10.176.64.38 with SMTP id h35mr16487927uad.141.1462666728700; Sat, 07 May 2016 17:18:48 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: tOTMmlvsCyubHwVsqGADOPkf2rc X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:108310 Thanks Chris I now have things working using a version 3.4.3 it finds subprocess.DEVNULL just fine *Jim Dodgen* On Sat, May 7, 2016 at 5:10 PM, Chris Angelico wrote: > On Sun, May 8, 2016 at 9:54 AM, Jim Dodgen wrote: > > The empty token is needed but useless, it is arg[0] most people just > repeat > > the program name > > Far from useless. It's how a process learns its own name, and yes, > repeating the image name is the most common way to provide that. > > > One other observation it looks as Popen behaves the same way as my fork > > exec would > > Indeed. In fact, I would strongly recommend never using an explicit > fork/exec from Python - always use subprocess or equivalent. On > non-Unix platforms, fork/exec may not be available, but subprocess can > use other methods of invoking programs. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list >