{"action":"created","issue":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/837","repository_url":"https://api.github.com/repos/KeepSafe/aiohttp","labels_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/837/labels{/name}","comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/837/comments","events_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/837/events","html_url":"https://github.com/KeepSafe/aiohttp/issues/837","id":142437072,"number":837,"title":"aiohttp.web: error: module 'C' not found using command line interface on Windows","user":{"login":"te-je","id":554780,"avatar_url":"https://avatars.githubusercontent.com/u/554780?v=3","gravatar_id":"","url":"https://api.github.com/users/te-je","html_url":"https://github.com/te-je","followers_url":"https://api.github.com/users/te-je/followers","following_url":"https://api.github.com/users/te-je/following{/other_user}","gists_url":"https://api.github.com/users/te-je/gists{/gist_id}","starred_url":"https://api.github.com/users/te-je/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/te-je/subscriptions","organizations_url":"https://api.github.com/users/te-je/orgs","repos_url":"https://api.github.com/users/te-je/repos","events_url":"https://api.github.com/users/te-je/events{/privacy}","received_events_url":"https://api.github.com/users/te-je/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/KeepSafe/aiohttp/labels/web","name":"web","color":"5319e7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-21T18:49:14Z","updated_at":"2016-03-22T05:43:03Z","closed_at":"2016-03-21T23:50:42Z","body":"## Long story short\r\n\r\nI get `aiohttp.web: error: module 'C' not found` when attempting to use the command line interface, no matter what my arguments are.\r\n\r\nIssue seems to be caused by `python -m` passing the location of the web.py script as the first item to sys.argv, and the parsing code doesn't seem to account for that.\r\n\r\n## Expected behaviour\r\n\r\n`python -m aiohttp.web my.module:func` should *at least* try to find `my.module`. \r\n\r\n## Actual behaviour\r\n\r\nThe script tries to find a module named `C` instead, and errors:\r\n```\r\n> python -m aiohttp.web \"glotpod.api:Application\"\r\nusage: aiohttp.web [-h] [-H HOSTNAME] [-P PORT] entry-func\r\naiohttp.web: error: module 'C' not found\r\n```\r\n\r\nNote that I get the same error too when I don't pass any arguments, and I shouldn't expect that either:\r\n```\r\n> python -m aiohttp.web\r\nusage: aiohttp.web [-h] [-H HOSTNAME] [-P PORT] entry-func\r\naiohttp.web: error: module 'C' not found\r\n```\r\n\r\n## Your environment\r\n\r\nWindows 10 64-bit, 32-bit Python, run from inside a pyvenv virtual environment. Using aiohttp 0.21.4.\r\n"},"comment":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/comments/199646895","html_url":"https://github.com/KeepSafe/aiohttp/issues/837#issuecomment-199646895","issue_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/837","id":199646895,"user":{"login":"asvetlov","id":356399,"avatar_url":"https://avatars.githubusercontent.com/u/356399?v=3","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T05:43:03Z","updated_at":"2016-03-22T05:43:03Z","body":"I did not cherry-pick the fix into 0.21.\r\nHave published 0.21.5 release for this."}}