hzulla / tolino-python

Access to tolino cloud with Python 3
GNU Lesser General Public License v2.1
78 stars 35 forks source link

Does not work with requests 2.11 (only 2.9.0) #19

Closed Gomez closed 6 years ago

Gomez commented 7 years ago

With requests 2.11 i get this error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/requests/utils.py", line 792, in check_header_validity
    if not pat.match(value):
TypeError: expected string or buffer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/jail/scripts/tolino-python/tolinoclient.py", line 161, in <module>
    args.func(args)
  File "/jail/scripts/tolino-python/tolinoclient.py", line 70, in upload
    c.register()
  File "/jail/scripts/tolino-python/tolinocloud.py", line 325, in register
    'm_id'        : self.partner_id
  File "/usr/local/lib/python3.4/site-packages/requests/sessions.py", line 535, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.4/site-packages/requests/sessions.py", line 474, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.4/site-packages/requests/sessions.py", line 407, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/local/lib/python3.4/site-packages/requests/models.py", line 303, in prepare
    self.prepare_headers(headers)
  File "/usr/local/lib/python3.4/site-packages/requests/models.py", line 443, in prepare_headers
    check_header_validity(header)
  File "/usr/local/lib/python3.4/site-packages/requests/utils.py", line 796, in check_header_validity
    "not %s" % (value, type(value)))
requests.exceptions.InvalidHeader: Header value 3 must be of type str or bytes, not <class 'int'>

I downgraded pip3.4 install requests==2.9.0 and it works now.

Furthermore it only works with python3.4 for me.