{"action":"created","issue":{"url":"https://api.github.com/repos/Rapptz/discord.py/issues/364","repository_url":"https://api.github.com/repos/Rapptz/discord.py","labels_url":"https://api.github.com/repos/Rapptz/discord.py/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/Rapptz/discord.py/issues/364/comments","events_url":"https://api.github.com/repos/Rapptz/discord.py/issues/364/events","html_url":"https://github.com/Rapptz/discord.py/issues/364","id":183239433,"number":364,"title":"Client.run with email + password fails ungracefully when account is using two factor authentication","user":{"login":"e00E","id":1462179,"avatar_url":"https://avatars.githubusercontent.com/u/1462179?v=3","gravatar_id":"","url":"https://api.github.com/users/e00E","html_url":"https://github.com/e00E","followers_url":"https://api.github.com/users/e00E/followers","following_url":"https://api.github.com/users/e00E/following{/other_user}","gists_url":"https://api.github.com/users/e00E/gists{/gist_id}","starred_url":"https://api.github.com/users/e00E/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e00E/subscriptions","organizations_url":"https://api.github.com/users/e00E/orgs","repos_url":"https://api.github.com/users/e00E/repos","events_url":"https://api.github.com/users/e00E/events{/privacy}","received_events_url":"https://api.github.com/users/e00E/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Rapptz/discord.py/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-15T23:39:39Z","updated_at":"2016-10-15T23:40:43Z","closed_at":"2016-10-15T23:40:43Z","body":"If I disable two factor authentication on my account the run function works just fine with my supplied email and password.\r\nIf enable it however I get an ugly exception:\r\n\r\n```\r\npython bot.py\r\nTraceback (most recent call last):\r\n  File \"bot.py\", line 43, in <module>\r\n    client.run('email', password')\r\n  File \"C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\discord\\client.py\", line 485, in run\r\n    self.loop.run_until_complete(self.start(*args, **kwargs))\r\n  File \"C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\lib\\asyncio\\base_events.py\", line 337, in run_until_com\r\nplete\r\n    return future.result()\r\n  File \"C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\lib\\asyncio\\futures.py\", line 274, in result\r\n    raise self._exception\r\n  File \"C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\lib\\asyncio\\tasks.py\", line 239, in _step\r\n    result = coro.send(None)\r\n  File \"C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\discord\\client.py\", line 456, in star\r\nt\r\n    yield from self.login(*args, **kwargs)\r\n  File \"C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\discord\\client.py\", line 382, in logi\r\nn\r\n    yield from getattr(self, '_login_' + str(n))(*args, **kwargs)\r\n  File \"C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\discord\\client.py\", line 340, in _log\r\nin_2\r\n    self._update_cache(email, password)\r\n  File \"C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\discord\\client.py\", line 191, in _upd\r\nate_cache\r\n    f.write(self.http.token)\r\nTypeError: write() argument must be str, not None\r\nUnclosed client session\r\nclient_session: <aiohttp.client.ClientSession object at 0x000001A8E1A66BA8>\r\n```\r\nIt would be perfect if discord.py supported two factor authentication or at least failed gracefully."},"comment":{"url":"https://api.github.com/repos/Rapptz/discord.py/issues/comments/254017857","html_url":"https://github.com/Rapptz/discord.py/issues/364#issuecomment-254017857","issue_url":"https://api.github.com/repos/Rapptz/discord.py/issues/364","id":254017857,"user":{"login":"Rapptz","id":1695103,"avatar_url":"https://avatars.githubusercontent.com/u/1695103?v=3","gravatar_id":"","url":"https://api.github.com/users/Rapptz","html_url":"https://github.com/Rapptz","followers_url":"https://api.github.com/users/Rapptz/followers","following_url":"https://api.github.com/users/Rapptz/following{/other_user}","gists_url":"https://api.github.com/users/Rapptz/gists{/gist_id}","starred_url":"https://api.github.com/users/Rapptz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rapptz/subscriptions","organizations_url":"https://api.github.com/users/Rapptz/orgs","repos_url":"https://api.github.com/users/Rapptz/repos","events_url":"https://api.github.com/users/Rapptz/events{/privacy}","received_events_url":"https://api.github.com/users/Rapptz/received_events","type":"User","site_admin":false},"created_at":"2016-10-15T23:40:43Z","updated_at":"2016-10-15T23:40:43Z","body":"I was specifically asked not to support the 2fa endpoints.\r\n\r\nOn that note, use the `bot.run('token', bot=False)` approach instead of using email + password combo."}}
{"actor":{"display_login":"Rapptz"}}