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. Danek _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
