dimanche 19 juin 2016

how to fix typeerror:'set' does not support the buffer interface?


I have code in python and when I try to run it i got this error, so whats wrong in my code? code:

sendparameter = {passname+'='+passwords[SID]}

response = requests.post(lurl, data=sendparameter, timeout=5, stream=True)

error:

Traceback (most recent call last):
  File "/usr/lib/python3.4/http/client.py", line 888, in send
    self.sock.sendall(data)
During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "sdps.py", line 159, in main
        response = requests.post(lurl, data=sendparameter, timeout=5, stream=True)
      File "/usr/lib/python3/dist-packages/requests/api.py", line 88, in post
        return request('post', url, data=data, **kwargs)
      File "/usr/lib/python3/dist-packages/requests/api.py", line 44, in request
        return session.request(method=method, url=url, **kwargs)
      File "/usr/lib/python3/dist-packages/requests/sessions.py", line 455, in request
        resp = self.send(prep, **send_kwargs)
      File "/usr/lib/python3/dist-packages/requests/sessions.py", line 558, in send
        r = adapter.send(request, **kwargs)
      File "/usr/lib/python3/dist-packages/requests/adapters.py", line 330, in send
        timeout=timeout
      File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 562, in urlopen
        body=body, headers=headers)
      File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 387, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/usr/lib/python3.4/http/client.py", line 1088, in request
        self._send_request(method, url, body, headers)
      File "/usr/lib/python3.4/http/client.py", line 1126, in _send_request
        self.endheaders(body)
      File "/usr/lib/python3.4/http/client.py", line 1084, in endheaders
        self._send_output(message_body)
      File "/usr/lib/python3.4/http/client.py", line 926, in _send_output
        self.send(message_body)
      File "/usr/lib/python3.4/http/client.py", line 892, in send
        self.sock.sendall(d)
    TypeError: 'str' does not support the buffer interface

i don't know , maybe way that i use to send my post request is wrong but i think its true and i cannot get where is problem


Aucun commentaire:

Enregistrer un commentaire