-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Internal Error w/ aio-pika==1.7.0 mypy=0.550 #4370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hm, this looks important. Could you please provide the code you checked with mypy that triggers this (or some hints about it, if it is private). Are there union types or generics involved? It looks like this is triggered by some assignment statement that looks like this: x = yield from function_call(...) In particular could you please tell are there forward references (annotations with types that are defined later in code) involved? |
@ilevkivskyi I am able to reproduce the
I don't actually use the I'm also not a contributor to |
OK, so it involves type-checking something in P = [TypeVar('P')]
# ... then later
result = yield from self.execute(func, payload)
# ... and even later
@asyncio.coroutine
def execute(self, func: Callable[P, R], payload: P) -> R:
... |
We got the same exception (though with a somewhat different traceback). The user sent me a repro (update: which I have not managed to confirm): class BaseClass(object):
def some_method(self):
# type: () -> BaseClass
pass
class SubClass1(BaseClass):
def some_method(self):
# type: () -> AnotherNameForSubClass1 # <--- Forward ref to alias causes crash
pass
AnotherNameForSubClass1 = SubClass1 The traceback ended in:
|
@gvanrossum I have a fix for the original crash, but I cannot reproduce your crash, there should be something else. |
PR #4375 should fix the original crash. |
I've made another issue for the crash my use saw: #4376 |
Maybe related: #4385 |
Reporting an INTERNAL_ERROR as requested.
The error appears to happen both from within my project and when running directy against
aio_pika
.I am not the developer of
aio-pika
.The text was updated successfully, but these errors were encountered: