Skip to content

[BUG] Defaults not working with MessageQueue #2015

Closed
@Bibo-Joshi

Description

@Bibo-Joshi

Steps to reproduce

  1. Set up a bot with a MessageQueue as described in the wiki

  2. pass a Defaults object to the bot

Expected behaviour

Defaults should be used

Actual behaviour

They're not. Instead ValueError("Function has keyword-only parameters or annotations" is raised

Why this happens & how to overcome

  1. getargspec is deprecated in favor of getfullargspec. This can easily be resolved
  2. This doesn't suffice yet, as the methods of MQBot override the bots methods and are decorated. getfullargspec can't see through the decorator. using inspect.getfullargspec(inspect.unwrap(method)) can resolve that
  3. This still only works, if we explicitly list the methods args & kwargs while overriden in MQBot

After #2012 this is one more reason to tackle MQ in v13.X/v14. Just adding inspect.getfullargspec(inspect.unwrap(method)) as a more or less quick fix doesn't really seem right to me …

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions