pylint-dev/pylint

Crash ``Building error when trying to create ast representation of module 'aws_cp.app'``

okelet opened this issue · 0 comments

When parsing the following file:

import os

from flask import Flask, g
from flask_pymongo import PyMongo
from pymongo.database import Database


class AwsCpApp(Flask):
    def __init__(self):
        super(AwsCpApp, self).__init__(__name__, static_url_path="/static", static_folder=os.path.join(os.path.dirname(__file__), "static"))
        self.logs_path = os.path.join(os.getcwd(), "emr-logs")

    def get_db(self) -> Database:
        db = getattr(g, "_database", None)
        if db is None:
            db = PyMongo(self).db
            g._database = db
        return db

pylint crashed with a AstroidBuildingError and with the following stacktrace:

Traceback (most recent call last):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference_tip.py", line 33, in _inference_tip_cached
    result = _cache[func, node]
             ~~~~~~^^^^^^^^^^^^
KeyError: (<function infer_typing_cast at 0x103f5a200>, <Call l.49 at 0x1062c76e0>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 1044, in get_ast
    return MANAGER.ast_from_file(filepath, modname, source=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/manager.py", line 138, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 145, in file_build
    return self._post_build(module, builder, encoding)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 169, in _post_build
    self.delayed_assattr(delayed)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 240, in delayed_assattr
    for inferred in node.expr.infer():
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 1162, in infer_assign
    stmts = list(self.assigned_stmts(context=context))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/protocols.py", line 412, in _arguments_infer_argname
    is_metaclass = isinstance(cls, nodes.ClassDef) and cls.type == "metaclass"
                                                       ^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1874, in _class_type
    if _is_metaclass(klass):
       ^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1845, in _is_metaclass
    for baseobj in base.infer():
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 334, in infer_import_from
    module = self.do_import_module()
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
    return mymodule.import_module(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
    return AstroidManager().ast_from_module_name(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/manager.py", line 246, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/manager.py", line 138, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 145, in file_build
    return self._post_build(module, builder, encoding)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 169, in _post_build
    self.delayed_assattr(delayed)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 240, in delayed_assattr
    for inferred in node.expr.infer():
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 1162, in infer_assign
    stmts = list(self.assigned_stmts(context=context))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/protocols.py", line 412, in _arguments_infer_argname
    is_metaclass = isinstance(cls, nodes.ClassDef) and cls.type == "metaclass"
                                                       ^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1874, in _class_type
    if _is_metaclass(klass):
       ^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1845, in _is_metaclass
    for baseobj in base.infer():
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 334, in infer_import_from
    module = self.do_import_module()
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
    return mymodule.import_module(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
    return AstroidManager().ast_from_module_name(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/manager.py", line 246, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/manager.py", line 138, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 145, in file_build
    return self._post_build(module, builder, encoding)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 169, in _post_build
    self.delayed_assattr(delayed)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 240, in delayed_assattr
    for inferred in node.expr.infer():
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 270, in infer_call
    for callee in self.func.infer(context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 358, in infer_attribute
    for owner in self.expr.infer(context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 1162, in infer_assign
    stmts = list(self.assigned_stmts(context=context))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/protocols.py", line 404, in _arguments_infer_argname
    functype = self.parent.type
               ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1517, in type
    _type = _infer_decorator_callchain(inferred)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1013, in _infer_decorator_callchain
    result = next(node.infer_call_result(node.parent), None)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1758, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 161, in infer
    results = list(self._explicit_inference(self, context, **kwargs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference_tip.py", line 40, in _inference_tip_cached
    result = _cache[func, node] = list(func(*args, **kwargs))
                                       ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/brain/brain_typing.py", line 405, in infer_typing_cast
    func = next(node.func.infer(context=ctx))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 358, in infer_attribute
    for owner in self.expr.infer(context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/inference.py", line 304, in infer_import
    yield self.do_import_module(self.real_name(name))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
    return mymodule.import_module(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
    return AstroidManager().ast_from_module_name(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/manager.py", line 246, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/manager.py", line 138, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 144, in file_build
    module, builder = self._data_build(data, modname, path)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/builder.py", line 204, in _data_build
    module = builder.visit_module(node, modname, node_file, package)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/rebuilder.py", line 254, in visit_module
    [self.visit(child, newnode) for child in node.body],
     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/astroid/rebuilder.py", line 609, in visit
    visit_method = getattr(self, visit_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TreeRebuilder' object has no attribute 'visit_typealias'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 730, in _get_asts
    ast_per_fileitem[fileitem] = self.get_ast(
                                 ^^^^^^^^^^^^^
  File "/Users/xxxxxx/Library/Caches/pypoetry/virtualenvs/aws-cp-F65XvQUA-py3.12/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 1066, in get_ast
    raise astroid.AstroidBuildingError(
astroid.exceptions.AstroidBuildingError: Building error when trying to create ast representation of module 'aws_cp.app'