[issue21080] asyncio.subprocess: connect pipes of two programs

2017-06-27 Thread STINNER Victor

STINNER Victor added the comment:

I don't see how to implement this idea, not if it's doable. Anyway, I'm not 
interested anymore to implement the idea, so I just close this old issue.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-06-06 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
components: +Asyncio

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-03-27 Thread STINNER Victor

New submission from STINNER Victor:

With the current asyncio API, it's not possible to implement the shell command 
ls | wc -l in Python: connect the stdin of a consumer to the stdin of a 
producer.

--
messages: 214994
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.subprocess: connect pipes of two programs
type: enhancement
versions: Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-03-27 Thread Guido van Rossum

Guido van Rossum added the comment:

How do you do that with the subprocess module, and why doesn't that work with 
asyncio?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-03-27 Thread STINNER Victor

STINNER Victor added the comment:

 How do you do that with the subprocess module

Something like that:
---
import subprocess
ls = subprocess.Popen([ls, -1], stdout=subprocess.PIPE)
wc = subprocess.Popen([wc, -l], stdin=ls.stdout)
ls.wait()
wc.wait()
---

 and why doesn't that work with asyncio?

It's possible with the two methods of an event loop, but I'm requesting this 
feature for the high-level API: asyncio.subprocess.

create_subprocess_shell(cat, stdout=subprocess.PIPE) starts immediatly to 
consume stdout, before I can connect the pipe to wc stdin. Currently, the 
asyncio.subprocess is designed to be able to write:
---
proc = yield from create_subprocess_exec(ls, stdout=subprocess.PIPE)
stdout, _ = yield from proc.communicate()
---

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-03-27 Thread Guido van Rossum

Guido van Rossum added the comment:

Oh, I see. Given that it is possible to do using event loop methods, why don't 
you write up a complete implementation and then propose to add that to the 
asyncio.subprocess module?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-03-27 Thread STINNER Victor

STINNER Victor added the comment:

 Oh, I see. Given that it is possible to do using event loop methods, why 
 don't you write up a complete implementation and then propose to add that to 
 the asyncio.subprocess module?

I don't know that a whole new implementation is needed. I guess that a
simpler change can be done on SubprocessStreamProtocol to ask to not
consume the pipe (don't attach a StreamReader to the pipe transport).

I still want to use streams at the end, so use the high-level API. Example:
---
ls = yield from create_subprocess_exec(ls, stdout=subprocess.PIPE)
grep = yield from create_subprocess_exec(grep, -v, -F, .old,
stdin=ls.stdin, stdout=subprocess.PIPE)
stdout, _ = yield from grep.communicate()
---

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-03-27 Thread Guido van Rossum

Guido van Rossum added the comment:

But how is the first call supposed to know that you don't want a StreamReader? 
Or the second that you do want one? Maybe we need a new constant instead of 
PIPE that means leave it hanging?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-03-27 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21080] asyncio.subprocess: connect pipes of two programs

2014-03-27 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21080
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com