[issue14000] Subprocess stdin.flush does not flush

2013-06-18 Thread Jian Wen
Jian Wen added the comment: The following code shows how to use pts. #!/usr/bin/env python import os import pty import shlex import time _args = "/usr/bin/ssh example.com" args = shlex.split(_args) pid, child_fd = pty.fork() if pid == 0: # Child os.execv("/usr/bin/ssh", args) else:

[issue14000] Subprocess stdin.flush does not flush

2012-02-13 Thread Ross Lagerwall
Ross Lagerwall added the comment: This appears to be a buffering issue with the tr program. Replace with ["cat", "-"] and it works whether the close() is in or not. To fix this, you need to open up the child process so that it is connected to a tty. man 4 pts if you want to investigate this f

[issue14000] Subprocess stdin.flush does not flush

2012-02-13 Thread Andrew Moffat
New submission from Andrew Moffat : The following code only works if the "p.stdin.close()" line is uncommented. It seems that stdin only flushes to the process on stdin.close(), not on stdin.flush(). --- import subprocess as subp import threading import time