Re: New line conversion with Popen attached to a pty

2013-06-21 Thread Dave Angel
On 06/20/2013 06:20 AM, Jonathan Harden wrote: Hi, We have a class which executes external processes in a controlled environment and does "things" specified by the client program with each line of output. To do this we have been attaching stdout from the subprocess.Popen to a pseudo terminal (

Re: New line conversion with Popen attached to a pty

2013-06-21 Thread jfharden
On Thursday, 20 June 2013 11:20:20 UTC+1, Jonathan Harden wrote: > ...SNIP > Sorry about the second post, it took a very long time to show up, long enough I thought it had been lost. -- http://mail.python.org/mailman/listinfo/python-list

Re: New line conversion with Popen attached to a pty

2013-06-21 Thread jfharden
On Thursday, 20 June 2013 23:04:39 UTC+1, Peter Otten wrote: > (2) Fiddle with terminal options, e. g. > > attrs = termios.tcgetattr(outSlave) > attrs[1] = attrs[1] & (~termios.ONLCR) | termios.ONLRET > termios.tcsetattr(outSlave, termios.TCSANOW, attrs) > > p = subprocess.Pop

New line conversion with Popen attached to a pty

2013-06-21 Thread Jonathan Harden
Hi, We have a class which executes external processes in a controlled environment and does "things" specified by the client program with each line of output. To do this we have been attaching stdout from the subprocess.Popen to a pseudo terminal (pty) made with pty.openempty and opened with os.

Re: New line conversion with Popen attached to a pty

2013-06-20 Thread Peter Otten
jfhar...@gmail.com wrote: > Hi, > > Sorry if this appears twice, I sent it to the mailing list earlier and the > mail seems to have been swallowed by the black hole of email vagaries. > > We have a class which executes external processes in a controlled > environment and does "things" specified

New line conversion with Popen attached to a pty

2013-06-20 Thread jfharden
Hi, Sorry if this appears twice, I sent it to the mailing list earlier and the mail seems to have been swallowed by the black hole of email vagaries. We have a class which executes external processes in a controlled environment and does "things" specified by the client program with each line of