Issue 18823: Idle: use pipes instead of sockets to talk with user subprocess (original) (raw)

Created on 2013-08-23 23:35 by terry.reedy, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
Carlson.py terry.reedy,2014-03-28 18:30
Messages (6)
msg196055 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-08-23 23:35
Idle once used os.spawnv to open the user subprocess and 2.7 still does. Sockets were then used to interact with the subprocess. Since rev71746, 2011-8-3, 3.2+ use subprocess.Popen but still use sockets. A rare but continual problem is failure to make the socket connection. In #16123, Amaury Forgeot d'Arc suggested "pipes?" The idea resurfaced again in current Idle-sig thread "Idle does not open on mac" (because socket connection timed out). Guido, who designed the current 2.x system, chimed in with "I would recommend trying to use the subprocess module." A current python-list thread indicates that there can be problems with "Running a command line program and reading the result as it runs" http://mail.python.org/pipermail/python-list/2013-August/654265.html In particular, "for line in p:" gets lines delayed (buffered) while Peter Otten discovered that "for line in iter(p.stdout.readline, ''):" gets them as they are produced. http://mail.python.org/pipermail/python-list/2013-August/654330.html We first need to experiment running a simple echo server with python(w).exe. I have not succeeded yet on Windows.
msg215062 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-03-28 18:30
In the thread that started here https://mail.python.org/pipermail/python-dev/2014-March/133492.html in this message. https://mail.python.org/pipermail/python-dev/2014-March/133671.html Josiah Carlson posted a pastebin link about how to actually use the pipes. Guido recommended that the he post a revised version to a new issue, as a patch to subprocess, but I am uploading it here to make sure it does not get lost.
msg215069 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-03-28 19:08
https://mail.python.org/pipermail/python-dev/2014-March/133641.html from Victor Stinner gives example code using asyncio
msg215123 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-03-29 08:44
Pydev, Re: Status of PEP 3145 - Asynchronous I/O for subprocess.popen; Antoine Pitrou: > Why don't you use multiprocessing or concurrent.futures? They have > everything you need for continuous conversation between processes.
msg336154 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-02-20 23:54
#34313 reports problems with multiprocessing when using at least some versions of tkinter on some versions of macOS.
msg370832 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-06-06 16:26
Problems with multiprocessing and tkinter on Mac might have been due to using the default start method, which used to be fork and is now spawn. This should be retested sometime.
History
Date User Action Args
2022-04-11 14:57:50 admin set github: 63023
2020-06-06 17:06:56 terry.reedy unlink issue16123 dependencies
2020-06-06 16:26:52 terry.reedy set nosy: - kbk, roger.serwymessages: + versions: + Python 3.10, - Python 3.8
2019-02-20 23:54:25 terry.reedy set messages: + versions: + Python 3.8, - Python 3.4, Python 3.5
2014-07-13 17:40:31 terry.reedy link issue16123 dependencies
2014-03-29 08:44:01 terry.reedy set stage: needs patchmessages: + versions: + Python 3.5, - Python 3.3
2014-03-28 19:08:19 terry.reedy set messages: +
2014-03-28 18:30:24 terry.reedy set files: + Carlson.pymessages: +
2014-02-02 05:44:00 kbk set nosy: + kbk
2013-09-04 18:44:57 ezio.melotti set nosy: + ezio.melotti
2013-08-31 16:19:15 serhiy.storchaka set nosy: + serhiy.storchaka
2013-08-30 22:23:12 tshepang set nosy: + tshepang
2013-08-26 06:19:44 asvetlov set nosy: + asvetlov
2013-08-23 23:35:04 terry.reedy create