Danek Duvall wrote:

> Danek Duvall wrote:
> 
> > Saurabh Vyas wrote:
> > 
> > > https://cr.opensolaris.org/action/browse/pkg/saurabhv/CR-7127117-rev1/webrev/
> > 
> > Please put commonize this into a function.  That function should take the
> > input str object and return a unicode object after doing the three tests,
> > and the final ascii/replace fallback.  Also, please use double quotes.
> 
> And it actually might make better sense to simply find the encoding of the
> output stream, and attempt only that before trying the replacement version.
> If you were going to sys.stdout, then you could use sys.stdout.encoding.
> I'm not sure how to get to that through the logging interfaces, but I'm
> sure there is one, if you dig in the right place.  But if you can find
> that, then you should use that, and only that.  Otherwise, your current
> fallback is fine.

Sorry for the stream of consciousness, but it occurred to me ask what the
encoding was if the output were simply redirected to a file, and that turns
out to be None, just as if it went to a pipe, and that seems annoying.  So
then it occurred to me whether (and if so, why) we should settle for ascii
output to either a file or a pipe, and frankly, I don't know the answer to
that, never mind what to do in that case.

Perhaps we can use your fix as a temporary workaround, but I don't think
this is the final answer.

Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to