Comments (20)
Yes, there isn't data
, so replace line41 of requests_oauthlib/core.py
with decoded_body = extract_params(r.body)
and replace line 50 with if hasattr(r, 'files') and contenttype == CONTENT_TYPE_MULTI_PART:
and then code should raise
raise TwythonAuthError("Seems something couldn't be verified with your OAuth junk. Error: %s, Message: %s" % (response.status_code, response.content))
from requests-oauthlib.
Pull Request? =D
from requests-oauthlib.
@Lukasa sure 👍
from requests-oauthlib.
I'm so not keeping up with the times. Just noticed randomly that this was split into it's own repo and broken with the requests refactoring while I was debugging some old code. I quick-fixed it in passing locally and was just about to add an issue here to remember to one day clean it up and push it. Lo and behold you guys are already on it. I love open source =)
hasattr(r, 'files') will however cause trouble since r in this case is a PreparedRequest without that attribute. If the prepare_auth was moved to after prepare_body (https://github.com/kennethreitz/requests/blob/master/requests/models.py#L201) then it would probably be fine just omitting the files check as the content type should be set.
I've not tested any multipart data yet tho so might be mistaken, I'll dig deeper later this week if none else beats me to it.
from requests-oauthlib.
Please get back to us with the result of your investigation. In the absence of good tests for this code, we need as much user feedback as possible. =)
from requests-oauthlib.
Well the reason the files check was there in the first place was because of the internal order of things in pre-1.0 requests where the content type was not always set, especially not before the auth call. The only thing this extension needs to do is to sort out some unicode issues (or else stuff will break deep down in other libraries, or so it used to) and help figure out content-type if not set.
I'll try and crave an hour or two out of tomorrow and add some tests for this. Anyone know if there is a particular reason for prepare_body coming after prepare_auth? If not that's a good place to start making life easier for content-type guessing.
Oh btw, and there is no full_url anymore, just url.
from requests-oauthlib.
This library has had only one change to bring it up to date with v1 of Requests, and that was #3. I'm spread way too thin to get around to this any time soon, so any help you can provide would be awesome. =)
from requests-oauthlib.
decoded_body and r.body being None under certain circumstances might also cause grief. I'll need to update myself a bit on how things are meant to be done with the new requests structure then patch it. That might take a day or two so don't hesitate to beat me to it...
from requests-oauthlib.
Know the feeling =) I'll try and sort it out either here or on oauthlibs side this week.
from requests-oauthlib.
Threw together some quick fixes in #4.
from requests-oauthlib.
I am so stupid! I have been beating my head against the wall because of this for at least an hour and a half!
Please push a new tag and update pypi. Thanks.
Until then, does anyone think the current master is ready for prime time?
from requests-oauthlib.
@mikofski requests-oauthlib
master is update-to-date with this change. requests
, I believe, is awaiting the changes to make this all working. See #4 (comment)
from requests-oauthlib.
Master works fine and you can see an example flask-twitter use here https://gist.github.com/4487236
Requests has pushed the change and it is included in at least 1.0.4. requests-oauthlib however needs to push master.
Note that you still need to provide all input in unicode. After oauthlib pushes 0.4 this will no longer be necessary if your input is utf-8 encoded. However, before I push I need to do some further testing. I'll ping this issue when done.
from requests-oauthlib.
Thanks @ib-lundgren & @michaelhelmick! I did ...
pip install -U git+git://github.com/requests/requests-oauthlib.git
which updated me to master and now all is well!
from requests-oauthlib.
was this included in a release? I'm seeing this issue now with req 1.2.0 and req-oauthlib 0.3.0
from requests-oauthlib.
It was included and is for certain in 0.3. Make sure that is really the version you are using as I'm unable to replicate this. If it persists please provide a stack trace / code sample.
from requests-oauthlib.
16:42:42 # pip freeze -l | grep requests
requests==1.2.0
requests-oauthlib==0.3.0
from requests-oauthlib.
sorry, I'll come back with a good sample replicating it soon but time doesn't allow at the moment. :/ I'll try to distill it down tomorrow.
from requests-oauthlib.
No worries. One thing that might help you is if you try and setup a new virtualenv and see if you still have the same error.
virtualenv test
source test/bin/activate
pip install requests-oauthlib
# try your code
from requests-oauthlib.
Okay, I see what's going on. It's intentional that data was going away and the preferred attribute is truly body. This pull request doesn't put the data attribute back, it updates requests-oauthlib to not rely on it. We were introspecting response.requests trying to build better error logs. Looks like we'll need to update our code accordingly. Thanks.
from requests-oauthlib.
Related Issues (20)
- Question: Is this project maintained? HOT 1
- Compliance fix for tokens that never expire (e.g. Mailchimp)
- Redo request after token is updated
- Why is the backend client workflow asking for a code or a response url? HOT 1
- refresh token workflow HOT 2
- rsengun HOT 1
- How to test if LinkedIn token is still valid and re-use? HOT 2
- 1.3.2 release? HOT 3
- (insecure_transport) OAuth 2 MUST utilize https. HOT 4
- LinkedIn issue with multiple scopes HOT 1
- ImportError: No module named parse HOT 3
- Remove 2.7 from setup.py HOT 2
- Access tokens leaked in logs when using DEBUG level
- 1.4.0 claims to support Python 2.7 in PyPI but does not HOT 2
- Changelog suggests Python 3.4-3.6 is unsupported, but project metadata allows these versions
- Release template purposal HOT 2
- Issue refreshing Wix OAuth tokens - cannot send payload as JSON using `refresh_token_request` compliance hook HOT 3
- Can you please add the ability to retrieve and provide the code verifier HOT 1
- BROKEN DOCUMENTATION: Backend Flow
- OAuth 2 web application flow not support PKCE??
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from requests-oauthlib.