27 Jul
2009
27 Jul
'09
12:04 p.m.
2009/7/27 Eric Pruitt <eric.pruitt@gmail.com>:
I am implementing the file wrapper using changes to subprocess.Popen that also make it asynchronous and non-blocking so implementing "r+" should be trivial to do. How about handling stderr? I have the following ideas: leave out support for reading from stderr, make it so that there is an optional additional argument like "outputstderr = False", create another function that toggles / sets whether stderr or stdout is returned or mix the two outputs.
I like MRAB's idea of using a (non-standard) "e" flag to include stderr. So "r" reads from stdout, "re" reads from stdout+stderr. Anything more complicated probably should just use "raw" Popen objects. Don't overcomplicate the interface. Paul.