-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Exception on completion from compiled object using JPype #1351
Comments
I would need more information about why this is happening. Maybe use pdb to step through this error. I feel like the StopIteration shouldn't be coming from |
Okay I will try to get some more information and get back to you. |
I have isolated the problem somewhat. The problem occurs only if the completion matches a PyJPField type which is another opaque object. But this type is property like rather than function like. It doesn't have annotations or anything special that should be causing a problem. I have generated a trace of the two points with structure dumps. Unfortunately the traces are each 10M. I will try to narrow it down further. |
The key point of difference seems to be when it is collection the final list. When successful it produces a CompiledName which results in a yield
When failing it made a EmptyCompiledName, then fell quickly into an empty list.
Does that help? I am applying a custom tracer with structure dumps on each call. I can look deeper if you want to isolate a particular structure, |
Here is a better trace of the final moments.
|
So the specific problem is
iter returned none because it was an EmptyCompiledName and then next was applied to None. |
Changing the line to
Corrected the problem. |
Hmm, what I don't understand is: How can it even be a You can also call |
It seems like jedi magic to me...
We start with a CompiledInstanceName
We call ContextSet
Still a CompiledInstanceName
The
Boom we have a bad result flow back to iter. So how did it get there in the first place? It originated here...
Then propagated here
|
Well, ok that was just laziness on my side. I actually didn't properly grep for it and didn't see the CompiledInstanceName subclass. I guess you can just create a pull request with the change you proposed. |
Okay I have the trace file loaded at ftp://ftp.llnl.gov/outgoing/nelson85/jedi/traceJedi.tar.gz if you would like to examine further. I will put in a pull request as soon as I am free. |
Thanks for your fix, it solves the exact same exception but with PyQT5 objects. import jedi
source = """
from PyQt5 import QtWidgets
foo = QtWidgets.QFrame()
foo."""
script = jedi.Script(source, 4, 4)
script.completions() # raise a RuntimeError: generator raised StopIteration However, I'm not used to call jedi directly (using thru spyder 4.0b2), but I guess it may solve #1236 too. |
This is a followup to #1347
Although completion is working for some cases, others are generating a RuntimeError in jedi.
Example:
Gives
['concat', 'contains', 'contentEquals']
Remove the "con" and we get...
Gives
The text was updated successfully, but these errors were encountered: