Skip to content

Django django.conf.settings mypy 990 check internal error #14039

Closed as not planned
@ObjatieGroba

Description

@ObjatieGroba

Report

Internal error while checking django.conf.settings

To Reproduce

from django.conf import settings

if hasattr(settings, 'IS_STANDALONE') and not settings.IS_STANDALONE:
    print(1)

Expected Behavior

No error

Actual Behavior

Operations to perform:
  Apply all migrations: admin, auth, contenttypes, guardian, serverconfig, sessions
Running migrations:
  No migrations to apply.
/home/igr/cpro/ng-admin/serverconfig/helper_functions.py:56: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
If this issue continues with mypy master, please report a bug at https://github.com/python/mypy/issues
version: 0.990
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 4665, in accept
  File "mypy/nodes.py", line 1957, in accept
  File "mypy/checkexpr.py", line 2769, in visit_op_expr
  File "mypy/checkexpr.py", line 3406, in check_boolean_op
  File "mypy/checker.py", line 5184, in find_isinstance_check
  File "mypy/checker.py", line 5223, in find_isinstance_check_helper
  File "mypy/checker.py", line 6486, in hasattr_type_maps
  File "mypy/checker.py", line 6522, in has_valid_attribute
  File "mypy/checkmember.py", line 191, in analyze_member_access
  File "mypy/checkmember.py", line 210, in _analyze_member_access
  File "mypy/checkmember.py", line 331, in analyze_instance_member_access
  File "mypy/checkmember.py", line 547, in analyze_member_var_access
  File "/home/igr/.local/lib/python3.10/site-packages/mypy_django_plugin/transformers/settings.py", line 24, in get_type_of_settings_attribute
    assert isinstance(ctx.context, MemberExpr)
AssertionError: 
/home/igr/cpro/ng-admin/serverconfig/helper_functions.py:56: : note: use --pdb to drop into pdb

Your Environment

Python 3.10.7

django-guardian 2.4.0
django-stubs 1.13.0
django-stubs-ext 0.7.0
mypy 0.990
mypy-extensions 0.4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions