-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Pyside2 completion causes KeyError loop #1294
Comments
Can you print the whole traceback if you get a long list? Because I don't see the same thing being repeated. |
You asked for it 😉 :
In [1]: from PySide2 import QtCore, QtWidgets, QtGui
Exception: [Errno 2] No such file or directory: '/Users/davidh/anaconda/envs/vispy_test_pyside2/lib/python3.6/site-packages/PySide2/support/signature/loader.py' During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
What I really don't understand is that there's no Jedi call in this traceback. I have really no idea what happens here. It's also not a recursion error, which is what you would expect if it was looping. Is this really the whole traceback? |
Yes it is the full traceback. You can see the line I typed at the top where I ended it by hitting the tab key. It then printed that huge long thing. Just a wild guess, is it possible my version of ipython is maybe repeatedly calling jedi because maybe jedi returned an empty list or string of possible completions and that was unexpected so it called again? Again, wild guess based on your confusion. |
The problem is that this doesn't help me. Something is missing, I'm not sure how and where it goes missing, but it's not there. This is certainly not the entry point for jedi and there's also no sign of something calling Jedi. So I don't really know what to do with this :/ Can you use the
Is the traceback the same? |
Putting that in to a script and running it with python 3.6 looks promising:
Same thing run from within ipython. I wonder if this is a bug in pyside2 and/or ipython and the traceback is just showing jedi. If you have other ideas I'm willing to try them. I can try doing some deeper debugging (pdb breakpoints, ipython, etc). |
To be honest I have no idea at this point. The question is probably: What is different between the Interpreter call I gave you and the one IPython does. |
Does it still happen with Jedi 0.14.0? |
Using Jedi 0.14.0, Qt 5.6.2, Pyside2 5.6.0a1, and ipython 7.5.0 all with a conda environment using packages from conda-forge, I still get this issue. |
Can you run:
|
|
Hmm this might be something about So the problem now is really, where does this print come from??!! |
Ok so I think I have a traceback that may be valid. You'll have to tell me if it looks right and makes any sense. I captured the output using IPython's utilities for capturing output. However, I didn't want to just capture it I wanted to know where it was coming from. I ran it once as normal and found it was all being printed to class FakeStdOut(StringIO):
def write(self, *args):
super(FakeStdOut, self).write("DEBUG:\n")
for line in traceback.format_stack():
super(FakeStdOut, self).write(line)
super(FakeStdOut, self).write("END DEBUG\n") And copied the class capture_output(object):
"""context manager for capturing stdout/err"""
stdout = True
stderr = True
def __init__(self, stdout=True, stderr=True):
self.stdout = stdout
self.stderr = stderr
def __enter__(self):
self.sys_stdout = sys.stdout
self.sys_stderr = sys.stderr
stdout = stderr = False
if self.stdout:
stdout = sys.stdout = FakeStdOut() # the only custom change here
if self.stderr:
stderr = sys.stderr = StringIO()
return CapturedIO(stdout, stderr)
def __exit__(self, exc_type, exc_value, traceback):
sys.stdout = self.sys_stdout
sys.stderr = self.sys_stderr Then did: with capture_output() as captured:
import jedi
from PySide2 import QtCore, QtWidgets, QtGui
completions = jedi.Interpreter('QtCore.', namespaces=[locals()]).completions()
x = [getattr(c, 'params', None) for c in completions]
print(captured.stdout[:captured.stdout.index('END DEBUG')]) And got:
Thoughts? |
Interesting. It looks like There you have the print statement. I guess this is not really a Jedi issue. Please open an issue there. Happy to keep discussing this, though. |
Thanks. I've created an issue on pyside's bug tracker. I'm a little worried that conda-forge only having 5.6 and there being much newer versions (5.11, 5.12, 5.13). Hopefully it isn't already fixed, but it would be hard for me to test. |
Just in case this annoys you too much for now: You could probably just copy this directory: https://github.com/pyside/pyside2-setup/blob/ff8b698d3547b39ba20c97a4c68881a4a789b211/sources/pyside2/PySide2/support/signature/loader.py |
On a conda python 3.6 environment on OSX using conda-forge packages, I did the following in an ipython session:
And get a long list of:
I've never used jedi directly so any help debugging this is appreciated. This may be related to #1287. This happens with jedi 0.12.1 and jedi 0.13.4.
The text was updated successfully, but these errors were encountered: