This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients michael.foord, r.david.murray
Date 2012-04-20.18:08:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334945284.24.0.289841146723.issue14634@psf.upfronthosting.co.za>
In-reply-to
Content
The following code:

  def foo(a, *, b=None):
    pass

  unittest.mock.create_autospec(foo)

fails with this traceback:

    Traceback (most recent call last):
      File "temp.py", line 6, in <module>
        unittest.mock.create_autospec(foo)
      File "/home/rdmurray/python/p33/Lib/unittest/mock.py", line 2026, in create_autospec
        mock = _set_signature(mock, spec)
      File "/home/rdmurray/python/p33/Lib/unittest/mock.py", line 162, in _set_signature
        result = _getsignature(original, skipfirst, instance)
      File "/home/rdmurray/python/p33/Lib/unittest/mock.py", line 81, in _getsignature
        regargs, varargs, varkwargs, defaults = inspect.getargspec(func)
      File "/home/rdmurray/python/p33/Lib/inspect.py", line 808, in getargspec
        raise ValueError("Function has keyword-only arguments or annotations"
    ValueError: Function has keyword-only arguments or annotations, use getfullargspec() API which can support them
History
Date User Action Args
2012-04-20 18:08:04r.david.murraysetrecipients: + r.david.murray, michael.foord
2012-04-20 18:08:04r.david.murraysetmessageid: <1334945284.24.0.289841146723.issue14634@psf.upfronthosting.co.za>
2012-04-20 18:08:03r.david.murraylinkissue14634 messages
2012-04-20 18:08:03r.david.murraycreate