New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use braintree_python on Google App Engine #53
Comments
I can confirm this problem this problem has been brought up to me at some events too. Not sure if an issue or documentation. |
@vrypan I believe this is a problem with a recent version of the requests library (a dependency of our library). Can you let us know what version of requests you're using, and try version 2.6.0 to see if that fixes it? |
We've tracked this down to a bug in urllib3 (urllib3/urllib3#616), a dependency of requests. It exists in requests version 2.6.1 and higher, so 2.6.0 is currently the latest version that works. |
I don't know for you guyz, but to avoid the issue, while waiting for a new release of the api, (and urllib3 if I read correctly) I use .encode('utf-8') on all the data I pass before making the transaction. It works but it is NOT a long term solution. I do not really like this.... |
@adrienbrunet The issue is now being tracked at https://github.com/kennethreitz/requests/issues/2595 and they will hopefully update their version of urllib3 soon. It would be helpful if you could post the exact details of your problem, so I can make sure the latest version of urllib3 fixes it. |
I've updated the appengine example to cover this problem. Basically, don't use requests 2.6.1, 2.6.2, or 2.7.0. Hopefully later versions will fix the issue. Alternatively, you can add this to your app.yaml:
see https://github.com/kennethreitz/requests/issues/2595#issuecomment-101795229 for more info. @adrienbrunet I don't think your issue is the same. If you're having unicode issues, you can email me at adam@getbraintree.com and I'll try to help you out. |
AI responses are gzip-encoded, but the python library (probably the requests library) treats them as ASCII.
Modifying http_do() in util/http.py to unzip the content, makes the library work again, but this is probably a fragile way to fix this. (unzip() is just a wrapper to unzip raw data, nothing special.)
The text was updated successfully, but these errors were encountered: