Skip to content

Mypy 1.16.0: TypeError: 'msg' is an invalid keyword argument for analyze_member_access() #2696

Closed
@ncvc

Description

@ncvc

Bug report

What's wrong

I'm getting this error when trying to upgrade from mypy 1.15.0 to 1.16.0. I'm guessing mypy updated the analyze_member_access function:

$ mypy . --show-traceback
/Users/ncvc/Library/Caches/pypoetry/virtualenvs/agent-webserver-p5YMsjuR-py3.12/lib/python3.12/site-packages/rest_framework/exceptions.py:240: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.16.0
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 5926, in accept
  File "mypy/nodes.py", line 1942, in accept
  File "mypy/checkexpr.py", line 3298, in visit_member_expr
  File "mypy/checkexpr.py", line 3328, in analyze_ordinary_member_access
  File "mypy/checkmember.py", line 220, in analyze_member_access
  File "mypy/checkmember.py", line 239, in _analyze_member_access
  File "mypy/checkmember.py", line 378, in analyze_instance_member_access
  File "mypy/checkmember.py", line 603, in analyze_member_var_access
  File "/Users/ncvc/Library/Caches/pypoetry/virtualenvs/agent-webserver-p5YMsjuR-py3.12/lib/python3.12/site-packages/mypy_django_plugin/transformers/functional.py", line 23, in resolve_str_promise_attribute
    return analyze_member_access(
           ^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'msg' is an invalid keyword argument for analyze_member_access()
/Users/ncvc/Library/Caches/pypoetry/virtualenvs/agent-webserver-p5YMsjuR-py3.12/lib/python3.12/site-packages/rest_framework/exceptions.py:240: : note: use --pdb to drop into pdb

How is that should be

No exception is thrown

System information

  • OS:
  • python version: 3.12.3
  • django version: 5.2.1
  • mypy version: 1.16.0
  • django-stubs version: 5.2.0
  • django-stubs-ext version: 5.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions