[Python-Dev] Implementing File Modes
Paul Moore
p.f.moore at gmail.com
Mon Jul 27 21:04:08 CEST 2009
2009/7/27 Eric Pruitt <eric.pruitt at 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.
More information about the Python-Dev
mailing list