[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread Berker Peksag
Berker Peksag added the comment: Please use Stack Overflow or python-list for usage questions (and please do not reopen this issue again) -- nosy: +berker.peksag resolution: works for me -> not a bug status: open -> closed ___ Python tracker

[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread pyguy
pyguy added the comment: The program does not work the way I wanted it to. I want the output of the top command to be seen only by the python program. The program I made causes the top command to print its output to the terminal. Using subprocess.Popen() with stdout=subprocess.PIPE does

[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread Ned Deily
Changes by Ned Deily : -- resolution: fixed -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread pyguy
pyguy added the comment: Using communicate fixed the problem. Here is the program that works for me on Mac OS 10.4.11 with Python 2.7.12: import subprocess import time print("Launch started") program_name = "top" list = [program_name] process = subprocess.Popen(list) while process.poll() ==

[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread Ned Deily
Ned Deily added the comment: There certainly could be differences in behavior considering how old 10.6.8 and 10.4.11 are. I'm not a subprocess expert but it seems to me that, if your program hangs doing a readline from process.stdout, chances are you are running into a pipe buffer deadlock

[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread pyguy
pyguy added the comment: The program failed for me on Mac OS 10.4.11 using Python 2.7.12 and Mac OS 10.6.8 using Python 2.7.13. -- status: pending -> open ___ Python tracker

[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread Ned Deily
Ned Deily added the comment: Sorry, your program works for me on macOS 10.12.3 with the current python.org 2.7.13, the Apple-supplied system Python 2.7.10, and, with adding a decode to the readline, with 3.6.0. -- resolution: -> works for me status: open -> pending

[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread pyguy
New submission from pyguy: When I use the subprocess module to run a another process, I expect to be able to read the STDOUT and STDERR of the other process. This is not possible on Mac OS X. The attached test program has been tested on Linux and Windows and does work as expected. It pauses