Skip to content

Python parser bugs #78

Description

@earwig
14-07-05 19:37:56 DEBUG bitshift.crawler.indexer.GitIndexer Indexing file: kennethreitz/requests: requests/packages/urllib3/packages/six.py
14-07-05 19:37:56 ERROR bitshift.crawler.indexer.GitIndexer Exception raised while parsing:
Traceback (most recent call last):
  File "bitshift/crawler/indexer.py", line 169, in _insert_repository_codelets
    parse(codelet)
  File "bitshift/parser/__init__.py", line 83, in parse
    symbols = PARSERS[lang_string](codelet)
  File "bitshift/parser/python.py", line 216, in parse_py
    walker.visit(tree)
  File "/usr/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/usr/lib/python2.7/ast.py", line 249, in generic_visit
    self.visit(item)
  File "/usr/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/usr/lib/python2.7/ast.py", line 249, in generic_visit
    self.visit(item)
  File "/usr/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "bitshift/parser/python.py", line 101, in visit_FunctionDef
    pos = self.block_position(node)
  File "bitshift/parser/python.py", line 46, in block_position
    temp_node = temp_node.body[-1]
TypeError: 'Str' object does not support indexing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions