Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73829

Re: Success with subprocess communicate on Windows?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Windows': 0.02; 'interpreter': 0.05; 'output': 0.05; 'args': 0.07; 'string': 0.09; 'exit': 0.09; 'literal': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'jan': 0.12; 'idle,': 0.16; 'idle.': 0.16; 'interpreter,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'variables,': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'command': 0.22; 'header :User-Agent:1': 0.23; 'right.': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'url:bugs': 0.29; 'am,': 0.29; 'tim': 0.29; 'gives': 0.31; 'code': 0.31; 'that.': 0.31; 'quotes': 0.31; 'skip:c 30': 0.32; 'url:python': 0.33; 'sense': 0.34; 'could': 0.34; 'subject:with': 0.35; 'skip:s 30': 0.35; 'but': 0.35; 'there': 0.35; 'explains': 0.36; 'idle': 0.36; 'interaction': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'list': 0.37; 'problems': 0.38; 'window': 0.38; 'to:addr :python-list': 0.38; 'explain': 0.39; 'does': 0.39; 'bad': 0.39; 'received:71': 0.39; 'reported': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'here': 0.66; '(hint:': 0.84; 'received:fios.verizon.net': 0.84; 'remembering': 0.84; 'shell,': 0.91; 'whereas': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Success with subprocess communicate on Windows?
Date Wed, 02 Jul 2014 05:05:51 -0400
References <mailman.11386.1404248789.18130.python-list@python.org> <iq27r9p1gg7nampcd6rr0pftrshinm9oog@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-71-175-90-87.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <iq27r9p1gg7nampcd6rr0pftrshinm9oog@4ax.com>
X-BeenThere python-list@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 <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.11405.1404291980.18130.python-list@python.org> (permalink)
Lines 39
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1404291980 news.xs4all.nl 2926 [2001:888:2000:d::a6]:48628
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:73829

Show key headers only | View raw


On 7/2/2014 12:33 AM, Tim Roberts wrote:
> Terry Reedy <tjreedy@udel.edu> wrote:
>>
>> It does not work on Windows. As I reported on
>> http://bugs.python.org/issue8631, msg222053,
>>>>> subprocess.check_output("pyflakes -h")
>> works in the interpreter and Idle shell, while
>>>>> s.check_output("pyflakes c:\programs\python34\lib\turtle.py")
>> gives bizarre output in the interpreter and hangs in the idle shell, as
>> does the code above.
>
> Right.  What do you think \t is in a string?  (Hint: it's only one byte.)

Yes, how could I forget that. But my use of a string literal here does 
not explain the problems when used string variables, as generated by os. 
I should try printing out the list of args passed to subprocess.

While remembering what \t is explains the command interpreter output 
(recursing through /lib), it does not explain the difference when 
invoked from Idle. There seems to be some bad interaction when calling 
subprocesses in the user subprocess.

> You need to use
>      s.check_output("pyflakes c:\\programs\\python34\\lib\\turtle.py")
> or
>      s.check_output(r"pyflakes c:\programs\python34\lib\turtle.py")

Now I get "Command 'pyflakes c:\programs\python34\lib\turtle.py' returns 
non-zero exit status 1" on both. On Idle, as least, a command-prompt 
window is flashed/displayed. It makes no sense to me that in the command 
interpreter,
'pyflakes c:\\programs\\python34\\lib' works and
'pyflakes c:\\programs\\python34\\lib\\turtle.py' returns status 1.
whereas both (with quotes elided and undoubled \) work at the command 
prompt.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Success with subprocess communicate on Windows? Terry Reedy <tjreedy@udel.edu> - 2014-07-01 17:05 -0400
  Re: Success with subprocess communicate on Windows? Tim Roberts <timr@probo.com> - 2014-07-01 21:33 -0700
    Re: Success with subprocess communicate on Windows? Terry Reedy <tjreedy@udel.edu> - 2014-07-02 05:05 -0400
    Re: Success with subprocess communicate on Windows? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-07-02 19:31 +0200
    Re: Success with subprocess communicate on Windows? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-07-02 19:37 +0200
    Re: Success with subprocess communicate on Windows? Terry Reedy <tjreedy@udel.edu> - 2014-07-02 19:14 -0400
    Re: Success with subprocess communicate on Windows? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-07-02 23:22 +0000
    Re: Success with subprocess communicate on Windows? Ethan Furman <ethan@stoneleaf.us> - 2014-07-02 16:54 -0700
    Re: Success with subprocess communicate on Windows? Terry Reedy <tjreedy@udel.edu> - 2014-07-03 00:09 -0400
    Re: Success with subprocess communicate on Windows? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-07-03 10:03 +0200
    Re: Success with subprocess communicate on Windows? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-07-03 11:22 +0200

csiph-web