{"action":"created","issue":{"url":"https://api.github.com/repos/klen/python-mode/issues/526","labels_url":"https://api.github.com/repos/klen/python-mode/issues/526/labels{/name}","comments_url":"https://api.github.com/repos/klen/python-mode/issues/526/comments","events_url":"https://api.github.com/repos/klen/python-mode/issues/526/events","html_url":"https://github.com/klen/python-mode/issues/526","id":55412954,"number":526,"title":"Pymode gets crash when checking default function arguments.","user":{"login":"gnaggnoyil","id":1560625,"avatar_url":"https://avatars.githubusercontent.com/u/1560625?v=3","gravatar_id":"","url":"https://api.github.com/users/gnaggnoyil","html_url":"https://github.com/gnaggnoyil","followers_url":"https://api.github.com/users/gnaggnoyil/followers","following_url":"https://api.github.com/users/gnaggnoyil/following{/other_user}","gists_url":"https://api.github.com/users/gnaggnoyil/gists{/gist_id}","starred_url":"https://api.github.com/users/gnaggnoyil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnaggnoyil/subscriptions","organizations_url":"https://api.github.com/users/gnaggnoyil/orgs","repos_url":"https://api.github.com/users/gnaggnoyil/repos","events_url":"https://api.github.com/users/gnaggnoyil/events{/privacy}","received_events_url":"https://api.github.com/users/gnaggnoyil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-25T12:11:51Z","updated_at":"2015-02-10T13:28:42Z","closed_at":null,"body":"Instead of reporting a syntax error, when the text contains a syntax error where a function has a default arguments that are not the last of the function arguments, pymode in vim simply gets crashed and results a vim \"E121: undefined variable: null\" error.\r\n\r\nFor example, I have this piece of Python 3 code in vim:\r\n```Python\r\ndef aaa(arg1, arg2 = 1, arg3):\r\n    print(1)\r\n\r\naaa(1,2,3)\r\n```\r\nThen I run pymode in vim, and pymode crashed with this error:\r\n\r\n```\r\n[Pymode] Code checking is running ...\r\n处理 function pymode#buffer_post_write..pymode#lint#check 时发生错误:\r\n第   11 行:\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 1, in <module>\r\n  File \"/home/gnaggnoyil/.vim/bundle/python-mode/pymode/lint.py\", line 71, in co\r\nde_check\r\n    env.run('g:PymodeLocList.current().extend', [e._info for e in errors])\r\n  File \"/home/gnaggnoyil/.vim/bundle/python-mode/pymode/environment.py\", line 18\r\n6, in run\r\n    self.prepare_value(a) for a in args\r\nvim.error: Vim(call):E121: 未定义的变量: null\r\n处理 function pymode#buffer_post_write 时发生错误:\r\n第   10 行:\r\nE171: 缺少 :endif\r\n```\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Place a bounty on it!](https://www.bountysource.com/issues/8018500-pymode-gets-crash-when-checking-default-function-arguments?utm_campaign=plugin&utm_content=tracker%2F42165&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F42165&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/klen/python-mode/issues/comments/73698631","html_url":"https://github.com/klen/python-mode/issues/526#issuecomment-73698631","issue_url":"https://api.github.com/repos/klen/python-mode/issues/526","id":73698631,"user":{"login":"rphlypo","id":5382938,"avatar_url":"https://avatars.githubusercontent.com/u/5382938?v=3","gravatar_id":"","url":"https://api.github.com/users/rphlypo","html_url":"https://github.com/rphlypo","followers_url":"https://api.github.com/users/rphlypo/followers","following_url":"https://api.github.com/users/rphlypo/following{/other_user}","gists_url":"https://api.github.com/users/rphlypo/gists{/gist_id}","starred_url":"https://api.github.com/users/rphlypo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rphlypo/subscriptions","organizations_url":"https://api.github.com/users/rphlypo/orgs","repos_url":"https://api.github.com/users/rphlypo/repos","events_url":"https://api.github.com/users/rphlypo/events{/privacy}","received_events_url":"https://api.github.com/users/rphlypo/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T13:28:42Z","updated_at":"2015-02-10T13:28:42Z","body":"see Issue #452"}}