[Freeipa-devel] [PATCH 0013] Remove user-unfriendly "u" character from error messages

Petr Viktorin pviktori at redhat.com
Wed Sep 5 13:42:07 UTC 2012


On 09/05/2012 03:19 PM, Tomas Babej wrote:
> Hi,
>
> User-unfriendly errors were caused by re-raising errors
> from external python module netaddr.
>
> https://fedorahosted.org/freeipa/ticket/2588
>
> Tomas
>
>
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel
>

I don't agree with this approach. Raising another module's errors in our 
code is ugly, and will break if netaddr changes. The arguments to pass 
to the exceptions are undocumented (see 
http://packages.python.org/netaddr/api.html#custom-exceptions). The 
wording of error messages in libraries can usually change at any time, 
and is intended for developers, not end users.

This should be either fixed upstream (unlikely, using the repr() of the 
argument is a sane thing to do at their side), or we should pass 
bytestrings to netaddr (a possible quick fix, not sure it it'll work), 
or, ideally, we should raise IPA's own errors.

-- 
Petr³




More information about the Freeipa-devel mailing list