[Yum-devel] [PATCH] YumRPMTransError: "errors" should not end up in e.value. BZ 966372

James Antill james at fedoraproject.org
Thu May 23 14:52:08 UTC 2013


On Thu, 2013-05-23 at 14:03 +0200, Zdenek Pavlas wrote:
> It's a DNF bug, but the Yum code is broken too, it's just
> harder to trigger this.  Patch fixes the following:
> 
> - Exception.__init__() should be called.
> - 'errors' should not be printed when handling the exception,
>   as the raising site did this already. There's just one user
>   in doTransaction().
> - 'msg' should be printed instead.
> - __str__() and __unicode__() overrides are void when using
>   e.value directly, should be dropped.

 As always the big problem is that this is a significant API change for
yum, so we'd need to somehow audit every piece of code that ever used
yum and make sure this doesn't affect them negatively.
 I'd guess that it probably doesn't, but it's much easier to just know
it doesn't because we didn't API break anything.

> reproducer:
> >>> e = yum.Errors.YumRPMTransError('Foo', [])
> >>> yum.i18n.exception2msg(e.value)

 Why call exception2msg(e.value) ? Does any code actually do that?
 exception2msg(e) works, right?

 What is the actual problem this solves, needing to call to_utf8() in
the __str__ function, like we do in YumBaseError?



More information about the Yum-devel mailing list