Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This issue is that there is a bug in the python-oauth2 module where a TypeError is thrown when the body of the request (or a followed request) is <code>None</code>. Here is the sign_request function in <code>oauth2/\_\_init\_\_.py</code>: </p> <pre><code>def sign_request(self, signature_method, consumer, token): """Set the signature parameter to the result of sign.""" if not self.is_form_encoded: # according to # http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html # section 4.1.1 "OAuth Consumers MUST NOT include an # oauth_body_hash parameter on requests with form-encoded # request bodies." self['oauth_body_hash'] = base64.b64encode(sha(self.body).digest()) if 'oauth_consumer_key' not in self: self['oauth_consumer_key'] = consumer.key if token and 'oauth_token' not in self: self['oauth_token'] = token.key self['oauth_signature_method'] = signature_method.name self['oauth_signature'] = signature_method.sign(self, consumer, token) </code></pre> <p>Line 493 is: </p> <pre><code>self['oauth_body_hash'] = base64.b64encode(sha(self.body).digest()) </code></pre> <p>So somehow the body is being set to <code>None</code>. Since httplib2 sets the request body to <code>None</code> when following redirects, my guess is that when you deployed online, there's a new redirect somewhere that httplib2 is following, which then sets the body to <code>None</code> and raises this error.</p> <p>The good news is that this is a bug I've fixed and <a href="https://github.com/simplegeo/python-oauth2/pull/138" rel="nofollow">issued a pull request</a>. Until it is accepted, you can either edit your own <code>oauth2/\_\_init\_\_.py</code> file to handle the case where the body is <code>None</code> or <a href="https://github.com/rickhanlonii/python-oauth2/tree/improve_sign_reques" rel="nofollow">download and use</a> my version of python-oauth.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload