[Yum-devel] [PATCH] Fix a corner case in exception2msg(). BZ 749239.

Zdenek Pavlas zpavlas at redhat.com
Wed Nov 2 08:22:14 UTC 2011


>  In general we can't have generic functions (like exception2msg())
> returning str and unicode in different code paths ... it almost
> guarantees unicode errors.

Yes.

> Also changing the return type is probably
> bad, even though it's relatively new.

Not changing, unifying :)

>  I think I originally had it return str() objects because it was
> replacing code like: "str(e)" with "exception2msg(e)" ... although
> now it's used in a few places where it'd be better as unicode now.

The 'return str()' code path was probably assumed to always return
ascii-clean strings, so they're already unicode-compatible.

> So maybe another function (uexception2msg?) or just lots of
> to_unicode calls?

IMO, every exception2msg() user handles (should handle) unicode.
So, this should not break anything, I guess.


More information about the Yum-devel mailing list