Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pygobject pygobject
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 278
    • Issues 278
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • pygobjectpygobject
  • Issues
  • #464

Closed
Open
Created Mar 29, 2021 by Vendula Poncova@poncovka

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).

See: https://github.com/rhinstaller/dasbus/pull/51

Assignee
Assign to
Time tracking