{"action":"opened","issue":{"url":"https://api.github.com/repos/lepture/flask-oauthlib/issues/238","labels_url":"https://api.github.com/repos/lepture/flask-oauthlib/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/lepture/flask-oauthlib/issues/238/comments","events_url":"https://api.github.com/repos/lepture/flask-oauthlib/issues/238/events","html_url":"https://github.com/lepture/flask-oauthlib/issues/238","id":104034286,"number":238,"title":"AttributeError due to incompatibility with newer OAuthlib version","user":{"login":"easoncxz","id":1837369,"avatar_url":"https://avatars.githubusercontent.com/u/1837369?v=3","gravatar_id":"","url":"https://api.github.com/users/easoncxz","html_url":"https://github.com/easoncxz","followers_url":"https://api.github.com/users/easoncxz/followers","following_url":"https://api.github.com/users/easoncxz/following{/other_user}","gists_url":"https://api.github.com/users/easoncxz/gists{/gist_id}","starred_url":"https://api.github.com/users/easoncxz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/easoncxz/subscriptions","organizations_url":"https://api.github.com/users/easoncxz/orgs","repos_url":"https://api.github.com/users/easoncxz/repos","events_url":"https://api.github.com/users/easoncxz/events{/privacy}","received_events_url":"https://api.github.com/users/easoncxz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-31T11:20:32Z","updated_at":"2015-08-31T11:20:32Z","closed_at":null,"body":"**TL;DR**: Flask-OAuthlib is out-of-date from OAuthlib and is hence causing exceptions to be raised. (I don't know how to fix it.)\r\n\r\nCurrently I'm seeing that `master` points to commit [cf24784fe4](https://github.com/lepture/flask-oauthlib/tree/cf24784fe47e434edf6e22f71b95251ffdc921da).\r\n\r\nAs I was using Flask-OAuthlib, [line 822 of flask_oauthlib/provider/oauth1.py](https://github.com/lepture/flask-oauthlib/blob/cf24784fe47e434edf6e22f71b95251ffdc921da/flask_oauthlib/provider/oauth1.py#L822) throws `AttributeError: request_token`. Here's my own stack trace at some point (it's not actually important; just posting for completeness):\r\n\r\n    Traceback (most recent call last):\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/app.py\", line 1836, in __call__\r\n        return self.wsgi_app(environ, start_response)\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/app.py\", line 1820, in wsgi_app\r\n        response = self.make_response(self.handle_exception(e))\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/app.py\", line 1403, in handle_exception\r\n        reraise(exc_type, exc_value, tb)\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/_compat.py\", line 33, in reraise\r\n        raise value\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/app.py\", line 1817, in wsgi_app\r\n        response = self.full_dispatch_request()\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/app.py\", line 1477, in full_dispatch_request\r\n        rv = self.handle_user_exception(e)\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/app.py\", line 1381, in handle_user_exception\r\n        reraise(exc_type, exc_value, tb)\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/_compat.py\", line 33, in reraise\r\n        raise value\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/app.py\", line 1475, in full_dispatch_request\r\n        rv = self.dispatch_request()\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask/app.py\", line 1461, in dispatch_request\r\n        return self.view_functions[rule.endpoint](**req.view_args)\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask_oauthlib/provider/oauth1.py\", line 402, in decorated\r\n        uri, http_method=http_method, body=body, headers=headers\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/oauthlib/oauth1/rfc5849/endpoints/authorization.py\", line 156, in get_realms_and_credentials\r\n        request.resource_owner_key, request):\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/flask_oauthlib/provider/oauth1.py\", line 822, in verify_request_token\r\n        tok = request.request_token or self._grantgetter(token=token)\r\n      File \"/Users/eason/Documents/2015S2/SE700B/flask_oauthlib_provider/.venv/lib/python3.4/site-packages/oauthlib/common.py\", line 412, in __getattr__\r\n        raise AttributeError(name)\r\n    AttributeError: request_token\r\n\r\nI found Travis job [#341.4](https://travis-ci.org/lepture/flask-oauthlib/jobs/72856247) to have a stack trace that's very similar to mine --- even line numbers are the same. Travis job [#345.4](https://travis-ci.org/lepture/flask-oauthlib/jobs/73519005), which is a few commits away from 341.4, does not show this AttributeError. Doing a manual diff reveals that the author ( @therealmarv ) changed `requirements.txt` between those two builds. You can download snapshots of those two commits and do a manual diff, but here's the interesting segment of it for convenience:\r\n\r\n    --- flask-oauthlib-fbeae3e5a1f33b7f68ba253bb01fcc8bca4f712a/requirements.txt\tTue Jul 28 03:40:40 2015\r\n    +++ flask-oauthlib-44bdfe4331afa86bd3613768a05bf7b05b9451f2/requirements.txt\tFri Jul 31 20:46:35 2015\r\n    @@ -1,5 +1,5 @@\r\n    +Flask==0.10.1\r\n    +mock==1.3.0\r\n    +oauthlib==0.7.2\r\n    +requests-oauthlib==0.5.0\r\n    +Flask-SQLAlchemy==2.0\r\n    -Flask\r\n    -Mock\r\n    -oauthlib\r\n    -requests-oauthlib\r\n    -Flask-SQLAlchemy\r\n\r\nI noticed `requirements.txt` in my own project to say\r\n\r\n    oauthlib==1.0.3\r\n\r\nwhereas Flask-OAuthlib's says\r\n\r\n    oauthlib==0.7.2\r\n\r\nThere is indeed a \"Breaking Change\" as per the [1.0.0](https://github.com/idan/oauthlib/blob/master/CHANGELOG.rst#100-2015-07-19) entry in OAuthlib's changelog that started raising attribute errors.\r\n\r\nTo reproduce some stack trace like mine that is caused by the same AttributeError, do something like the below:\r\n\r\n    git clone git@github.com:lepture/flask-oauthlib.git\r\n    git checkout master\r\n    # virtualenv and activate\r\n    pip install -r requirements.txt\r\n    pip install -U oauthlib    # currently on version 1.0.3 as noted above"}}