Open hnisonoff opened 8 years ago
Hello, and thanks for the report!
Jedi..............: 0.7.0 (0.9.0 available)
Could you upgrade Jedi and see if that solves the problem?
Thanks for the reply!
I still received this error.
Elpy Error
The backend encountered an unexpected error. This indicates a bug in Elpy. Please open a bug report with the data below in the Elpy bug tracker:
https://github.com/jorgenschaefer/elpy/issues/new
Error Message
u'struct'
Configuration
Virtualenv........: hunternisonoff (/Users/hunternisonoff)
RPC Python........: 2.7.11 (/usr/local/bin/python)
Interactive Python: python (/usr/local/bin/python)
Emacs.............: 24.5.1
Elpy..............: 1.8.0
Jedi..............: 0.9.0
Rope..............: 0.10.3
Importmagic.......: 0.1.7
Syntax checker....: flake8 (/Library/Frameworks/Python.framework/Versions/3.5/bin/flake8)
Traceback
Traceback (most recent call last):
File "/Users/hunternisonoff/.emacs.d/elpa/elpy-1.8.0/elpy/jedibackend.py", line 303, in run_with_debug
return getattr(script, name)()
File "/usr/local/lib/python2.7/site-packages/jedi/api/__init__.py", line 185, in completions
user_stmt = self._parser.user_stmt_with_whitespace()
File "/usr/local/lib/python2.7/site-packages/jedi/cache.py", line 143, in wrapper
result = func(self)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/user_context.py", line 303, in user_stmt_with_whitespace
user_stmt = self.user_stmt()
File "/usr/local/lib/python2.7/site-packages/jedi/cache.py", line 143, in wrapper
result = func(self)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/user_context.py", line 293, in user_stmt
module = self.module()
File "/usr/local/lib/python2.7/site-packages/jedi/parser/user_context.py", line 339, in module
return self._parser().module
File "/usr/local/lib/python2.7/site-packages/jedi/cache.py", line 143, in wrapper
result = func(self)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/user_context.py", line 283, in _parser
parser = FastParser(self._grammar, self._source, self._path)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/fast.py", line 109, in __call__
p.update(source)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/fast.py", line 257, in update
self._parse(source)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/fast.py", line 383, in _parse
line_offset, nodes)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/fast.py", line 435, in _get_node
p = Parser(self._grammar, parser_code, self.module_path, tokenizer=tokenizer)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/__init__.py", line 155, in __init__
self.module = p.parse(self._tokenize(tokenizer))
File "/usr/local/lib/python2.7/site-packages/jedi/parser/pgen2/parse.py", line 106, in parse
if self.addtoken(type, value, prefix, start_pos):
File "/usr/local/lib/python2.7/site-packages/jedi/parser/pgen2/parse.py", line 170, in addtoken
value, start_pos, prefix, self.addtoken)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/__init__.py", line 269, in error_recovery
self._stack_removal(grammar, stack, index + 1, value, start_pos)
File "/usr/local/lib/python2.7/site-packages/jedi/parser/__init__.py", line 304, in _stack_removal
clear_names(children=node[1])
File "/usr/local/lib/python2.7/site-packages/jedi/parser/__init__.py", line 298, in clear_names
self._scope_names_stack[-1][c.value].remove(c)
KeyError: u'struct'
Jedi Debug Information
Jedi did not emit any debug info.
Reproduction:
import jedi
source = '''\
#!/usr/bin/python
from Bio.PDB import PDBParser
print(3+3)
p = PDBParser()
struct = p.get_structure('1get', '1get.pdb')
resList = struct.get_residues()
struct.get_atoms.map(lambda'''
script = jedi.Script(column=27, source=source, line=8, encoding='utf-8', path=u'/Users/hunternisonoff/test.py')
script.completions()
Thank you! This looks like a new error, and seems to be a bug in Jedi. I'll report it upstream.
Elpy Error
The backend encountered an unexpected error. This indicates a bug in Elpy. Please open a bug report with the data below in the Elpy bug tracker:
https://github.com/jorgenschaefer/elpy/issues/new
Reproduction: