Dealing with errors in interactive subprocess running python interpreter that freeze the process

cseberino at gmail.com cseberino at gmail.com
Thu Aug 2 15:51:04 EDT 2018


> -I think the Python interpreter actually sends its output to stderr, so to capture it you'd probably want it to go to the same place as stdout, so use stderr = subprocess.STDOUT

Yes that captured the error messages!  Thanks! 

> -You're only reading 1 line out output for each thing, so if 1 command creates multiple lines of output then you won't be showing them all.

Yes.  That is the one remaining problem.  I tried replacing the readline with read and readlines and both froze/blocked.

cs



More information about the Python-list mailing list