Skip to content

inspect.signature fails on some functions which use Argument Clinic #64360

Description

@serhiy-storchaka
BPO 20161
Nosy @larryhastings, @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/larryhastings'
closed_at = <Date 2014-01-07.20:53:31.930>
created_at = <Date 2014-01-07.09:38:39.405>
labels = ['type-bug']
title = 'inspect.signature fails on some functions which use Argument Clinic'
updated_at = <Date 2014-01-07.20:53:31.930>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2014-01-07.20:53:31.930>
actor = 'larry'
assignee = 'larry'
closed = True
closed_date = <Date 2014-01-07.20:53:31.930>
closer = 'larry'
components = []
creation = <Date 2014-01-07.09:38:39.405>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 20161
keywords = []
message_count = 3.0
messages = ['207521', '207522', '207593']
nosy_count = 2.0
nosy_names = ['larry', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue20161'
versions = ['Python 3.4']

Activity

  1. serhiy-storchaka commented on Jan 7, 2014

    @serhiy-storchaka
    MemberAuthor

    inspect.signature fails on some functions which use Argument Clinic. For example after applying bpo-20133 or bpo-20151 it fails for audioop.ratecv and binascii.a2b_qp.

    >>> inspect.signature(audioop.ratecv)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/serhiy/py/cpython/Lib/inspect.py", line 1468, in signature
        return Signature.from_builtin(obj)
      File "/home/serhiy/py/cpython/Lib/inspect.py", line 1989, in from_builtin
        p(name, default)
      File "/home/serhiy/py/cpython/Lib/inspect.py", line 1982, in p
        default = default.n
    AttributeError: type object '_empty' has no attribute 'n'
  2. larryhastings commented on Jan 7, 2014

    @larryhastings
    Contributor

    I already noticed this; it'll be fixed in the patch for bpo-20144. But thanks for the report!

  3. larryhastings commented on Jan 7, 2014

    @larryhastings
    Contributor

    Fixed as a side effect of fixing bpo-20144. And by the way this was never a release blocker.

  4. self-assigned this
    on Jan 7, 2014
  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions