Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail 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; 'subject:Windows': 0.02; 'board.': 0.05; '64-bit': 0.07; 'binary': 0.07; 'intel': 0.07; 'linux,': 0.07; 'subject:PEP': 0.07; 'subject:support': 0.07; '*is*': 0.09; '32-bit': 0.09; 'handful': 0.09; 'subject:using': 0.09; 'windows,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'windows': 0.15; "'configure'": 0.16; 'accepts': 0.16; 'bsd': 0.16; 'chip': 0.16; 'default:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'portable': 0.16; 'solaris,': 0.16; 'subject: \n ': 0.16; 'subject:API': 0.16; 'those,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'module': 0.19; "hasn't": 0.19; "python's": 0.19; 'restrictions': 0.19; 'stefan': 0.19; 'things.': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'days,': 0.24; 'lets': 0.24; 'library,': 0.24; "shouldn't": 0.24; 'subject: .': 0.24; 'java': 0.24; 'cc:2**0': 0.24; 'script': 0.25; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'external': 0.29; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; 'went': 0.31; 'code': 0.31; 'that.': 0.31; 'concern': 0.31; 'once,': 0.31; 'os,': 0.31; 'figure': 0.32; 'run': 0.32; 'running': 0.33; 'mac': 0.33; 'subject:from': 0.34; "can't": 0.35; 'etc': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'behind': 0.37; 'too': 0.37; 'level': 0.37; 'pm,': 0.38; 'does': 0.39; 'commands': 0.60; 'then,': 0.60; 'worry': 0.60; 'hope': 0.61; "you're": 0.61; 'times': 0.62; 'high': 0.63; 'maximum': 0.63; 'offering': 0.63; 'networking': 0.64; 'different': 0.65; 'taking': 0.65; 'between': 0.67; 'facilities': 0.69; 'bulk': 0.74; 'behavior': 0.77; 'yourself': 0.78; '2015': 0.84; 'completely,': 0.84; 'differences,': 0.84; 'omission': 0.84; 'one;': 0.84; 'precious': 0.84; 'subject:skip:F 10': 0.84; 'whopping': 0.84; 'care,': 0.91; 'facilities.': 0.91; 'reasoning': 0.91; 'to:none': 0.92 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=5yJvqYjkJbALbzXhrk5z8tj18IeQpa42YInd88/iang=; b=XfNtOZIYZWLPIOZ82teT9jF8+cWeCLMyIh6KpROFNQ82ul9QJ7g5nyThsP7tHMOvrw UtUQrb/Pntb79zE9j59TlLqzJXufobxgHp7JPM2QwGoqqfhRT5elQAbUMkmNLiM6svZQ iRqpB6WrXBy6V1Z+udNrXo10vvzgVW4x4HzjICds5t7bzGLrnpVqO99ENi7CN8oiufQ9 LoCHyu8Vbfr34rS6xepsDWlDSYz9jb0o5yLTpDgcZ2f+27xeCL1gEfUtr+N6KZLfa6cp wbUrm0ZZtDa5GRXGKzm9vGgpkkWpCt9CxQkswuD/lj/PxYhboB8n+MHfDYRoq1mKQkpe n+/Q== MIME-Version: 1.0 X-Received: by 10.42.43.199 with SMTP id y7mr2916601ice.12.1430994261397; Thu, 07 May 2015 03:24:21 -0700 (PDT) In-Reply-To: <87ioc4k89v.fsf@elektro.pacujo.net> References: <554AB8A5.708@davea.name> <554adcf8$0$11103$c3e8da3@news.astraweb.com> <1c51085e-7795-4afc-9a4c-ad8b3f3a73a6@googlegroups.com> <87ioc4k89v.fsf@elektro.pacujo.net> Date: Thu, 7 May 2015 20:24:21 +1000 Subject: Re: PEP idea: On Windows, subprocess should implicitly support .bat and .cmd scripts by using FindExecutable from win32 API From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430994265 news.xs4all.nl 2841 [2001:888:2000:d::a6]:37046 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90096 On Thu, May 7, 2015 at 8:10 PM, Marko Rauhamaa wrote: > Stefan Zimmermann : > >> And last but not least, Popen behavior on Windows makes it difficult >> to write OS-independent Python code which calls external commands that >> are not binary by default: > > Then, write OS-dependent Python code. > > I don't think it's Python's job to pave over OS differences. Java does > that by not offering precious system facilities -- very painful. Python > is taking steps in that direction, but I hope it won't go too far. On the contrary, I think it *is* a high level language's job to pave over those differences. Portable C code generally has to have a whopping 'configure' script that digs into your hardware, OS, library, etc availabilities, and lets you figure out which way to do things. Python code shouldn't need to worry about that. You don't need to care whether you're on a 32-bit or 64-bit computer; you don't need to care whether it's an Intel chip or a RISCy one; you shouldn't have to concern yourself with the difference between BSD networking and WinSock. There'll be a handful of times when you do care, and for those, it's nice to have some facilities exposed; but the bulk of code shouldn't need to know about the platform it's running on. Java went for a philosophy of "write once, run anywhere" in its early days, and while that hasn't exactly been stuck to completely, it's still the reasoning behind the omission of certain system facilities. Python accepts and understands that there will be differences, so you can't call os.getuid() on Windows, and there are a few restrictions on the subprocess module if you want maximum portability, but the bulk of your code won't be any different on Linux, Windows, Mac OS, OS/2, Amiga, OS/400, Solaris, or a MicroPython board. ChrisA