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


Groups > comp.lang.python > #33932

Re: how to pass "echo t | " input to subprocess.check_output() method

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <dachakku@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'argument': 0.04; 'output': 0.04; 'attribute': 0.05; 'svn': 0.05; 'python': 0.09; 'exception,': 0.09; 'p2cread': 0.09; 'res': 0.09; 'subject:method': 0.09; 'throws': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'library': 0.15; 'passing': 0.15; '"echo': 0.16; 'command,': 0.16; 'stdin': 0.16; 'subject:pass': 0.16; 'url:svn': 0.16; 'string': 0.17; 'wrote:': 0.17; 'input': 0.18; 'skip:" 30': 0.20; 'all,': 0.21; 'subversion': 0.22; 'help.': 0.22; 'cc:2**0': 0.23; 'monday,': 0.23; 'cc:no real name:2**0': 0.24; 'command': 0.24; 'pass': 0.25; 'tried': 0.25; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:m 30': 0.26; 'this?': 0.28; 'writes:': 0.29; 'error': 0.30; 'file': 0.32; 'could': 0.32; 'skip:s 30': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'process,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'url:org': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'think': 0.40; 'from:no real name:2**0': 0.60; 'url:ip addr': 0.62; 'email addr:gmail.com': 0.63; 'dont': 0.64; 'validate': 0.65; 'url:0': 0.67; 'prompt': 0.78; 'received:209.85.213.184': 0.91; 'subject:skip:s 20': 0.91
Newsgroups comp.lang.python
Date Mon, 26 Nov 2012 04:10:57 -0800 (PST)
In-Reply-To <mailman.286.1353927741.29569.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=65.49.14.51; posting-account=3hCTQwoAAAD9MQ94kNfxVdNpAnVvA3IX
References <d8bd2825-3e3a-4b0f-9679-bc86094c4b8c@googlegroups.com> <mailman.286.1353927741.29569.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-IP 65.49.14.51
MIME-Version 1.0
Subject Re: how to pass "echo t | " input to subprocess.check_output() method
From dachakku@gmail.com
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Cc python-list@python.org
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.288.1353931866.29569.python-list@python.org> (permalink)
Lines 70
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1353931866 news.xs4all.nl 6852 [2001:888:2000:d::a6]:59456
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33932

Show key headers only | View raw


On Monday, 26 November 2012 16:32:22 UTC+5:30, Kushal Kumaran  wrote:
> dachakku@gmail.com writes:
> 
> 
> 
> > Hi all,
> 
> >
> 
> > I want to list the repositories in svn using python. For this i have used below command,
> 
> > " res = subprocess.check_output(["svn.exe", "list", "Https://127.0.0.1:443/svn/Repos"], stderr=subprocess.STDOUT) "
> 
> >
> 
> > but it throws an exception, since it requires an user input to validate certificate,
> 
> > " (R)eject, accept (t)emporarily or accept (p)ermanently? "
> 
> >
> 
> > from Command prompt im able to pass the input while calling the process, and im able to get the output
> 
> >
> 
> > "echo t | svn list Https://127.0.0.1:443/svn/Repos"
> 
> >
> 
> > But i dont know how to pass the "echo t | " in subprocess.check_output while calling a process.
> 
> > Is there a way to do this?
> 
> > Please help.
> 
> 
> 
> 
> 
> You could pass in a stdin argument to subprocess.check_output with a
> 
> value of 't\n'.
> 
> 
> 
> However, you might want to use something like http://pysvn.tigris.org/,
> 
> which is a python library for accessing subversion repositories.
> 
> 
> 
> -- 
> 
> regards,
> 
> kushal

Hi Kushal,

I tried passing the value 't\n' to check_output. But I think we cannot pass a string to stdin.

When I tried the below command,
subprocess.check_output([svn, "list", repos_Url], stdin='t\n', stderr=subprocess.STDOUT)

I got the below error message,
  File "C:\Python27\lib\subprocess.py", line 786, in _get_handles
    p2cread = msvcrt.get_osfhandle(stdin.fileno())
AttributeError: 'str' object has no attribute 'fileno'

could you tell me how to pass the value to stdin..

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


Thread

how to pass "echo t | " input to subprocess.check_output() method dachakku@gmail.com - 2012-11-26 02:36 -0800
  Re: how to pass "echo t | " input to subprocess.check_output() method Duncan Booth <duncan.booth@invalid.invalid> - 2012-11-26 10:52 +0000
    Re: how to pass "echo t | " input to subprocess.check_output() method dachakku@gmail.com - 2012-11-26 04:05 -0800
      Re: how to pass "echo t | " input to subprocess.check_output() method Duncan Booth <duncan.booth@invalid.invalid> - 2012-11-26 12:17 +0000
  Re: how to pass "echo t | " input to subprocess.check_output() method Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2012-11-26 16:32 +0530
    Re: how to pass "echo t | " input to subprocess.check_output() method dachakku@gmail.com - 2012-11-26 04:10 -0800
      Re: how to pass "echo t | " input to subprocess.check_output() method Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2012-11-26 18:45 +0530
    Re: how to pass "echo t | " input to subprocess.check_output() method dachakku@gmail.com - 2012-11-26 04:10 -0800
  Re: how to pass "echo t | " input to subprocess.check_output() method Miki Tebeka <miki.tebeka@gmail.com> - 2012-11-26 07:40 -0800
    Re: how to pass "echo t | " input to subprocess.check_output() method dachakku@gmail.com - 2012-11-28 04:38 -0800
      Re: how to pass "echo t | " input to subprocess.check_output() method Miki Tebeka <miki.tebeka@gmail.com> - 2012-11-28 06:47 -0800

csiph-web