{"action":"created","issue":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/725","labels_url":"https://api.github.com/repos/JukkaL/mypy/issues/725/labels{/name}","comments_url":"https://api.github.com/repos/JukkaL/mypy/issues/725/comments","events_url":"https://api.github.com/repos/JukkaL/mypy/issues/725/events","html_url":"https://github.com/JukkaL/mypy/issues/725","id":96800580,"number":725,"title":"Infinite loop when processing certain packages.","user":{"login":"public","id":83000,"avatar_url":"https://avatars.githubusercontent.com/u/83000?v=3","gravatar_id":"","url":"https://api.github.com/users/public","html_url":"https://github.com/public","followers_url":"https://api.github.com/users/public/followers","following_url":"https://api.github.com/users/public/following{/other_user}","gists_url":"https://api.github.com/users/public/gists{/gist_id}","starred_url":"https://api.github.com/users/public/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/public/subscriptions","organizations_url":"https://api.github.com/users/public/orgs","repos_url":"https://api.github.com/users/public/repos","events_url":"https://api.github.com/users/public/events{/privacy}","received_events_url":"https://api.github.com/users/public/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-23T12:15:12Z","updated_at":"2015-07-24T05:46:07Z","closed_at":null,"body":"I discovered this when trying to run MyPy on https://github.com/pyca/cryptography\r\n\r\n`mypy -m cryptography` hangs forever at 100% CPU. Via PDB and strace I found that it was processing the same files over and over and never getting anywhere.\r\n\r\nI have reduced this to a fairly simple test case.\r\n\r\nCreate a package like\r\n\r\n`LOOP/__init__.py`\r\n```\r\nfrom LOOP.SUBLOOP import LOOPVAR\r\n```\r\n\r\n`LOOP/SUBLOOP.py`\r\n```\r\nLOOPVAR = \"Loops!\"\r\n```\r\n\r\nRun `mypy -m LOOP`. It will never complete.\r\n\r\nI have tested this on Python 3.4.0 with MyPy 0.2.0 on Ubuntu 14.04.\r\n\r\nI'm currently at EuroPython if anyone who knows about this stuff would like to pair on fixing it or just getting a reproduction working :)\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/comments/124336904","html_url":"https://github.com/JukkaL/mypy/issues/725#issuecomment-124336904","issue_url":"https://api.github.com/repos/JukkaL/mypy/issues/725","id":124336904,"user":{"login":"o11c","id":964689,"avatar_url":"https://avatars.githubusercontent.com/u/964689?v=3","gravatar_id":"","url":"https://api.github.com/users/o11c","html_url":"https://github.com/o11c","followers_url":"https://api.github.com/users/o11c/followers","following_url":"https://api.github.com/users/o11c/following{/other_user}","gists_url":"https://api.github.com/users/o11c/gists{/gist_id}","starred_url":"https://api.github.com/users/o11c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o11c/subscriptions","organizations_url":"https://api.github.com/users/o11c/orgs","repos_url":"https://api.github.com/users/o11c/repos","events_url":"https://api.github.com/users/o11c/events{/privacy}","received_events_url":"https://api.github.com/users/o11c/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T05:46:07Z","updated_at":"2015-07-24T05:46:07Z","body":"Although import logic *is* screwed up, `mypy -m LOOP` isn't valid python code if LOOP is a package unless you have a `__main__.py`, and additionally it is never possible to import from the main module since it would be imported twice.\r\n\r\nIf you want to tell mypy to test a single module, try using my fork (branch `driver`, PR failing due to *other* import bugs) and running `mypy -c 'import LOOP'`."}}