[Freeipa-devel] [PATCH] 0748 Handle encoding for ipautil.run

Petr Viktorin pviktori at redhat.com
Wed Nov 18 23:55:05 UTC 2015


On 11/03/2015 02:39 PM, Petr Viktorin wrote:
> Hello,
> Python 3's strings are Unicode, so data coming to or leaving a Python
> program needs to be decoded/encoded if it's to be handled as a string.
> One of the boundaries where encoding is necessary is external programs,
> specifically, ipautil.run.
> Unfortunately there's no one set of options that would work for all
> run() invocations, so I went through them all and specified the
> stdin/stdout/stderr encoding where necessary. I've also updated the call
> sites to make it clearer if the return values are used or not.
> If an encoding is not set, run() will accept/return bytes. (This is a
> fail-safe setting, since it can't raise errors, and using bytes where
> strings are expected generally fails loudly in py3.)
> 
> Note that the changes are not effective under Python 2.

ping,
Could someone look at this patch?


-- 
Petr Viktorin




More information about the Freeipa-devel mailing list