On 30 Aug 2014 21:08, "Antoine Pitrou"
On Fri, 29 Aug 2014 18:39:35 +1000 Nick Coghlan
wrote: This actually gets a little messy once you start digging into it, as you actually have up to 3 streams to deal with (stdin, stdout, stderr), and
may
want to set the error handler in addition to the encoding.
At this point, I'd suggest creating a clean, separate TextPopen class (or subclass) without any legacy argument baggage.
As for per-stream settings, we could allow passing each of *encoding* and *errors* in two forms: - as a string, in which case it applies to all three pipes - as a dict, in which case it is looked up for each of the "stdin", "stdout", "stderr" pipes (if configured as pipes)
We could then deprecate the bogus-named "universal_newlines" in the main Popen class.
That sounds like a plausible plan to me - splitting the API like that also reflects what was needed to get IO working sensibly in the first place. Cheers, Nick.