Closed cglacet closed 4 years ago
Is it possible to find a minimal reproduction example?
I'm actually very surprised but yes! Here is the minimal 3-line file I could reproduce the bug with:
main.py
from aiohttp import web
my_web_app = web.Application()
my_web_app.router.add_get('/trip', index)
Thanks, I can reproduce with:
pylint 2.3.0-dev1
astroid 2.1.0
Python 3.7.2 (default, Jan 16 2019, 19:49:22)
and
aiohttp==3.5.4
I cut down the code with the error (aiohttp/web_urldispatcher.py
) until I couldn't remove any more code.
Here's my minimum working example without aiohttp:
from typing import (
Iterable,
Sized,
)
class AbstractResource(Sized, Iterable):
def __init__(self):
self.bar = 1 # Probably triggers inference
@SamyCookie yeah this is no longer an issue on master, thanks
When I run pylint on one of my (large) file, it crashes on the last line. The last thing that is printed as a pylint error is:
The complete stack trace is:
``` Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/astroid/bases.py", line 168, in getattr values = self._proxied.instance_attr(name, context) File "/usr/local/lib/python3.7/site-packages/astroid/scoped_nodes.py", line 2270, in instance_attr context=context) astroid.exceptions.AttributeInferenceError: 'router' not found on