Regression: DBusConnection.register_object ignores arguments of partial objects
Since pygobject-3.40.0, a partial object used as a method call closure of Gio.DBusConnection.register_object is called without its predefined arguments.
def callback(connection, sender, object_path, interface_name, method_name, parameters, invocation, user_data):
pass
method_call_closure = partial(
callback,
user_data=("Some", "additional", "data")
)
connection.register_object(
object_path,
interface_info,
method_call_closure,
None,
None
)
In the example above, the callback
function has one additional argument called user_data
that should be provided by the partial object called method_call_closure
. However, the code will fail with TypeError: callback() missing 1 required positional argument: 'user_data'
. It means that the callback
function is called without additional arguments defined by the partial object.
It looks like the register_object
method at some point drops the predefined arguments of the partial object and calls the wrapped function without them.
The example is working with pygobject-3.38.0-3 (on Fedora Rawhide).