Skip to content
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

requrests 2.11 requires string only headers #44

Closed
tetor opened this issue Aug 24, 2016 · 1 comment
Closed

requrests 2.11 requires string only headers #44

tetor opened this issue Aug 24, 2016 · 1 comment

Comments

@tetor
Copy link

tetor commented Aug 24, 2016

api.projects.get_by_slug() can't work because requests 2.11 changed to accept string only headers.

https://github.com/kennethreitz/requests/issues/3477

Error

Traceback (most recent call last):
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/requests/utils.py", line 796, 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 "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/taiga/requestmaker.py", line 102, in get
    params=query
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/requests/sessions.py", line 461, in request
    prep = self.prepare_request(req)
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/requests/sessions.py", line 394, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/requests/models.py", line 295, in prepare
    self.prepare_headers(headers)
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/requests/models.py", line 409, in prepare_headers
    check_header_validity(header)
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/requests/utils.py", line 800, in check_header_validity
    "not %s" % (value, type(value)))
requests.exceptions.InvalidHeader: Header value True must be of type str or bytes, not <class 'bool'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "src/taiga_io.py", line 28, in <module>
    pprint(api.me())
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/taiga/client.py", line 88, in me
    return self.users.get('me')
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/taiga/models/base.py", line 47, in get
    endpoint=self.instance.endpoint, id=resource_id
  File "/Users/tetor/.pyenv/versions/cf-tpp/lib/python3.4/site-packages/taiga/requestmaker.py", line 109, in get
    'Network error!', 'GET'
taiga.exceptions.TaigaRestException: Network error!
@yakky
Copy link
Member

yakky commented Aug 27, 2016

Thanks @tetor for reporting
Fixed in #43
Released in 0.8.6

@yakky yakky closed this as completed Aug 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants