Message 97090 - Python tracker (original) (raw)
I agree with Florian Mayer that the encoding handling should be stream-specific. You could easily be reading the stdout of some third party program that uses, say, latin1, but want to do your own output in, say, utf-8.
One solution that builds on what Amaury Forgeot d'Arc has done (i.e., the encoding and errors parameters) by allowing those parameters to accept either a single string (as now), or a dict with keys 'stdin', 'stdout', 'stderr'. Of course it is possible that the client might not specify all the dict's keys in which case those would use the normal default (local 8-bit etc.)