authd_client = fitbit.Fitbit('consumer_key', 'consumer_secret', oauth2=True, access_token='access_token', refresh_token='refresh_token')
authd_client.sleep()
I'm getting the following error from the OpenSSL library in my global config. Thinking it's a problem with libaries, I created a virtualenv and installed via pip install -r requirements/base.txt. I'm still getting the same problem.
(venv)fitbit โค python fit.py
Traceback (most recent call last):
File "fit.py", line 19, in <module>
client.sleep()
File "/usr/local/lib/python2.7/dist-packages/fitbit/utils.py", line 38, in _curried
return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
File "/usr/local/lib/python2.7/dist-packages/fitbit/api.py", line 454, in _COLLECTION_RESOURCE
return self.make_request(url, data)
File "/usr/local/lib/python2.7/dist-packages/fitbit/api.py", line 362, in make_request
response = self.client.make_request(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/fitbit/api.py", line 193, in make_request
response = self._request(method, url, data=data, auth=auth, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/fitbit/api.py", line 180, in _request
return self.session.request(method, url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 362, in send
timeout=timeout
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 516, in urlopen
body=body, headers=headers)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 308, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python2.7/httplib.py", line 1001, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 826, in send
self.sock.sendall(data)
File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 208, in sendall
return self.connection.sendall(data)
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 969, in sendall
raise TypeError("buf must be a byte string")
TypeError: buf must be a byte string