On 06/16/12 06:33 AM, Danek Duvall wrote:
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.
Thanks a lot Danek for you inputs....
I have commonized the code & test that too on the S11 FCS system.
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.
I am not sure about this (tried few ways of getting the encoding for
logging module, no success till now).
Please if any guide me on what could be the best way here
Perhaps we can use your fix as a temporary workaround, but I don't think
this is the final answer.
I am yet to put test cases (may be cover non ascii supported & fallback
ascii scenario), may be in a day or two.
Thanks again,
Saurabh
Danek
--
Saurabh Vyas
Solaris Install Group,
Revenue Product Engineering (RPE), Systems |Bangalore |
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss