[Yum-devel] [PATCH] Fix a corner case in exception2msg(). BZ 749239.
James Antill
james.antill at redhat.com
Tue Nov 1 22:13:16 UTC 2011
On Mon, 2011-10-31 at 10:01 +0100, Zdeněk Pavlas wrote:
> Under some locales, python creates UTF8 encoded non-unicode
> exceptions. For such, exception2msg() returns values that
> fail to convert to unicode.
In general we can't have generic functions (like exception2msg())
returning str and unicode in different code paths ... it almost
guarantees unicode errors. Also changing the return type is probably
bad, even though it's relatively new.
I think I originally had it return str() objects because it was
replacing code like: "str(e)" with "exception2msg(e)" ... although not
it's used in a few places where it'd be better as unicode now. So maybe
another function (uexception2msg?) or just lots of to_unicode calls?
More information about the Yum-devel
mailing list