question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AssertionError: invalid argspec BoundMethodArgSpecWrapper

See original GitHub issue
Traceback (most recent call last):
  File "/v/site-packages/pyanalyze/name_check_visitor.py", line 705, in visit
    ret = method(node)
  File "/v/site-packages/pyanalyze/name_check_visitor.py", line 2843, in visit_Subscript
    return_value, _ = self._get_argspec_and_check_call(
  File "/v/site-packages/pyanalyze/name_check_visitor.py", line 3372, in _get_argspec_and_check_call
    extended_argspec = self._get_argspec_from_value(callee_wrapped, node)
  File "/v/site-packages/pyanalyze/name_check_visitor.py", line 3465, in _get_argspec_from_value
    return self._get_argspec(callee_wrapped.val, node, name=name)
  File "/v/site-packages/pyanalyze/name_check_visitor.py", line 3495, in _get_argspec
    return self.arg_spec_cache.get_argspec(obj, name=name, logger=self.log)
  File "/v/site-packages/pyanalyze/arg_spec.py", line 1124, in get_argspec
    argspec = self._cached_get_argspec(obj, kwargs)
  File "/v/site-packages/pyanalyze/arg_spec.py", line 1136, in _cached_get_argspec
    extended = self._uncached_get_argspec(obj, kwargs)
  File "v/site-packages/pyanalyze/arg_spec.py", line 1161, in _uncached_get_argspec
    return BoundMethodArgSpecWrapper(argspec, KnownValue(obj.__self__))
  File "/v/site-packages/pyanalyze/arg_spec.py", line 142, in __init__
    assert isinstance(argspec, ExtendedArgSpec), "invalid argspec %r" % (argspec,)
AssertionError: invalid argspec BoundMethodArgSpecWrapper(
  argspec=ExtendedArgSpec(
    _has_return_value=False,
    arguments=[Parameter(default_value=<object object at 0x7fa6a833f990>, name='self', typ=None)],
    implementation=None,
    kwargs='kwargs',
    kwonly_args=None,
    name='GenericAlias',
    params_of_names={
      'self': Parameter(default_value=<object object at 0x7fa6a833f990>, name='self', typ=None),
      'args': Parameter(default_value=<object object at 0x7fa6a833f990>, name='args', typ=TypedValue(typ=<class 'tuple'>)),
      'kwargs': Parameter(default_value=<object object at 0x7fa6a833f990>, name='kwargs', typ=TypedValue(typ=<class 'dict'>))},
    return_value=UnresolvedValue(), starargs='args'),
    self_value=TypedValue(typ=<class 'types.GenericAlias'>))

Internal error: AssertionError(-"-) (code: internal_error)

I’m sorry the code is closed-source, I could try to track it down somehow… I get this error using Python 3.9.0b1 but not 3.8

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JelleZijlstracommented, Jun 1, 2020

The mypy issue is an unrelated bug that will be fixed in the next mypy release (the AST for subscripts was changed and mypy got confused about it).

0reactions
JelleZijlstracommented, Jun 2, 2020

#7 should fix this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AssertionError: Invalid type <class 'NoneType'> for key ...
I am using torch 1.10.0 with prebuilt detectron2 0.6 with CUDA 11.1. The mentioned codepiece still exists in the main branch, so I...
Read more >
AssertionError: the given combination of arguments (promise ...
AssertionError : the given combination of arguments (promise and string) is invalid for this assertion. You can use an array, a map, ...
Read more >
AssertionError: Invalid MXD filename...why? - Esri Community
Solved: Hi, I have a simple script for batch exporting .mxds to .PNG: import arcpy, os ws = arcpy.env.workspace =
Read more >
Python | Assertion Error - GeeksforGeeks
Example 1: Assertion error with error_message. Python3 ... "Invalid Operation" # denominator can't be 0 AssertionError: Invalid Operation.
Read more >
arcpy - Assertion Error, python - GIS Stack Exchange
I am trying to make a tool for exporting pdfs from a directory: I found one online but it was very slow, I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found