should request_name org.freedesktop.DBus fail?

Havoc Pennington hp at redhat.com
Wed Nov 9 12:06:33 PST 2005


On Wed, 2005-11-09 at 12:13 +0000, Robert McQueen wrote:
> 
> All fair points, and I'll change the Python bindings so that a return of
> 0 from the library function throws you an unchecked exception like
> ValueError. The reason I asked was the inconsistency. If you send a
> message to RequestName manually, with a valid UTF-8 string, but an
> invalid name, you get an error reply from the bus daemon explaining the
> error of your ways. However, if you call request_name in the library
> with the same value, it barfs, prints rudeness to the console, and
> returns a value to your program that's not written in the API
> documentation. It just seemed a little unusual when I ran into it, but
> I'll accept your argument that this is how it should be.

The inconsistency is a little odd perhaps. I would buy that the bus
should disconnect you instead of sending an error in this case. We don't
want the bus to enter an undefined state though - unlike the client lib
it has to have defined behavior on invalid input.

Havoc




More information about the dbus mailing list