{"action":"created","issue":{"url":"https://api.github.com/repos/jonathanslenders/ptpython/issues/44","labels_url":"https://api.github.com/repos/jonathanslenders/ptpython/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/jonathanslenders/ptpython/issues/44/comments","events_url":"https://api.github.com/repos/jonathanslenders/ptpython/issues/44/events","html_url":"https://github.com/jonathanslenders/ptpython/issues/44","id":79230268,"number":44,"title":"Strange parsing errors ","user":{"login":"xiaoweiz","id":4540215,"avatar_url":"https://avatars.githubusercontent.com/u/4540215?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaoweiz","html_url":"https://github.com/xiaoweiz","followers_url":"https://api.github.com/users/xiaoweiz/followers","following_url":"https://api.github.com/users/xiaoweiz/following{/other_user}","gists_url":"https://api.github.com/users/xiaoweiz/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaoweiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaoweiz/subscriptions","organizations_url":"https://api.github.com/users/xiaoweiz/orgs","repos_url":"https://api.github.com/users/xiaoweiz/repos","events_url":"https://api.github.com/users/xiaoweiz/events{/privacy}","received_events_url":"https://api.github.com/users/xiaoweiz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jonathanslenders/ptpython/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-22T01:15:24Z","updated_at":"2015-05-31T10:31:22Z","closed_at":"2015-05-31T10:31:22Z","body":"While typing the following `lambda` expression with two arguments, `lambda a, b: a if a > b else b`, I got a parsing error\r\n\r\nIt was fine at first\r\n```python\r\nlambda a, b: a \r\n```\r\nuntil I typed  \"space\" and `i`, the error popped up\r\n\r\n```python\r\nlambda a, b: a iException in thread Thread-18:\r\nTraceback (most recent call last):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/cache.py\", line 141r\r\n    return getattr(self, name)\r\nAttributeError: 'UserContextParser' object has no attribute '__parser'\r\n\r\nDuring handling of the above exception, another exception occurred:idebar - CPython 3.4.3\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"s\r\n    clear_names(c.children)\r\nAttributeError: 'Name' object has no attribute 'children'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/ptpython/utils.py\", linet\r\n    namespaces=[locals, globals])\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/api/__init__.py\", l_\r\n    self._parser.module())\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/user_contexte\r\n    return self._parser().module\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/cache.py\", line 143r\r\n    result = func(self)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/user_contextr\r\n    parser = Parser(self._grammar, self._source, self._path)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"_\r\n    self.module = p.parse(self._tokenize(tokenizer))\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/pgen2/parse.e\r\n    if self.addtoken(type, value, prefix, start_pos):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/pgen2/parse.n\r\n    value, start_pos, prefix, self.addtoken)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"y\r\n    self._stack_removal(grammar, stack, index + 1, value, start_pos)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"l\r\n    clear_names(children=node[1])\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"s\r\n    clear_names(c.children)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"s\r\n    clear_names(c.children)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"s\r\n    self._scope_names_stack[-1][c.value].remove(c)\r\nKeyError: 'a'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/threading.py\", line 920, in _bootstrapr\r\n    self.run()\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/threading.py\", line 868, in run\r\n    self._target(*self._args, **self._kwargs)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/prompt_toolkit/interfacen\r\n    CompleteEvent(text_inserted=True)))\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/prompt_toolkit/contrib/rs\r\n    self._get_completions_for_match(m, complete_event))\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/prompt_toolkit/contrib/rs\r\n    for i in items:\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/prompt_toolkit/contrib/rh\r\n    for completion in completer.get_completions(document, complete_event):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/ptpython/completer.py\", s\r\n    script = get_jedi_script_from_document(document, self.get_locals(), self.get_globals()\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/ptpython/utils.py\", linet\r\n    except jedi.common.MultiLevelStopIteration:\r\nAttributeError: 'module' object has no attribute 'MultiLevelStopIteration'\r\n\r\nException in thread Thread-19:\r\nTraceback (most recent call last):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/cache.py\", line 141r\r\n    return getattr(self, name)\r\nAttributeError: 'UserContextParser' object has no attribute '__parser'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"s\r\n    clear_names(c.children)\r\nAttributeError: 'Name' object has no attribute 'children'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/ptpython/utils.py\", linet\r\n    namespaces=[locals, globals])\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/api/__init__.py\", l_\r\n    self._parser.module())\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/user_contexte\r\n    return self._parser().module\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/cache.py\", line 143r\r\n    result = func(self)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/user_contextr\r\n    parser = Parser(self._grammar, self._source, self._path)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"_\r\n    self.module = p.parse(self._tokenize(tokenizer))\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/pgen2/parse.e\r\n    if self.addtoken(type, value, prefix, start_pos):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/pgen2/parse.n\r\n    value, start_pos, prefix, self.addtoken)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"y\r\n    self._stack_removal(grammar, stack, index + 1, value, start_pos)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"l\r\n    clear_names(children=node[1])\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"s\r\n    clear_names(c.children)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"s\r\n    clear_names(c.children)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/jedi/parser/__init__.py\"s\r\n    self._scope_names_stack[-1][c.value].remove(c)\r\nKeyError: 'a'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/threading.py\", line 920, in _bootstrapr\r\n    self.run()\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/threading.py\", line 868, in run\r\n    self._target(*self._args, **self._kwargs)\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/ptpython/python_input.pyn\r\n    script = get_jedi_script_from_document(document, self.get_locals(), self.get_globals()\r\n  File \"/Users/zhangxiaowei/anaconda/lib/python3.4/site-packages/ptpython/utils.py\", linet\r\n    except jedi.common.MultiLevelStopIteration:\r\nAttributeError: 'module' object has no attribute 'MultiLevelStopIteration'\r\n```"},"comment":{"url":"https://api.github.com/repos/jonathanslenders/ptpython/issues/comments/107152214","html_url":"https://github.com/jonathanslenders/ptpython/issues/44#issuecomment-107152214","issue_url":"https://api.github.com/repos/jonathanslenders/ptpython/issues/44","id":107152214,"user":{"login":"jonathanslenders","id":216638,"avatar_url":"https://avatars.githubusercontent.com/u/216638?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanslenders","html_url":"https://github.com/jonathanslenders","followers_url":"https://api.github.com/users/jonathanslenders/followers","following_url":"https://api.github.com/users/jonathanslenders/following{/other_user}","gists_url":"https://api.github.com/users/jonathanslenders/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanslenders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanslenders/subscriptions","organizations_url":"https://api.github.com/users/jonathanslenders/orgs","repos_url":"https://api.github.com/users/jonathanslenders/repos","events_url":"https://api.github.com/users/jonathanslenders/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanslenders/received_events","type":"User","site_admin":false},"created_at":"2015-05-31T10:31:22Z","updated_at":"2015-05-31T10:31:22Z","body":"This was fixed in: https://github.com/jonathanslenders/ptpython/commit/4589d7bb51fee5ba0cc7058df601fb83d4f80526\r\n\r\nI will do a new Pypi release soon."}}