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

requests 2.11.0 breaks pyrax ttl #615

Open
danandersonasc opened this issue Aug 13, 2016 · 2 comments
Open

requests 2.11.0 breaks pyrax ttl #615

danandersonasc opened this issue Aug 13, 2016 · 2 comments

Comments

@danandersonasc
Copy link

requests 2.11.0 release a few days ago changed outgoing header validation. Now it is not possible for pyrex to set X-Delete-After to an integer value.

  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/object_storage.py", line 2688, in store_object
    headers=headers, metadata=metadata)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/object_storage.py", line 2758, in create_object
    metadata=metadata, headers=headers, return_none=return_none)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/object_storage.py", line 78, in _wrapped
    return fnc(self, container, *args, **kwargs)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/object_storage.py", line 1377, in create_object
    return_none=return_none)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/object_storage.py", line 430, in create
    return_none=return_none)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/object_storage.py", line 1863, in create
    chunk_size, headers)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/object_storage.py", line 1901, in _upload
    chunked=chunked, chunk_size=chunk_size, headers=headers)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/object_storage.py", line 1943, in _store_object
    headers=headers)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/client.py", line 260, in method_put
    return self._api_request(uri, "PUT", **kwargs)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/client.py", line 231, in _api_request
    resp, body = self._time_request(safe_uri, method, **kwargs)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/client.py", line 193, in _time_request
    resp, body = self.request(uri, method, **kwargs)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/client.py", line 184, in request
    resp, body = pyrax.http.request(method, uri, *args, **kwargs)
  File "/opt/test/ve/lib/python2.7/site-packages/pyrax/http.py", line 63, in request
    resp = req_method(uri, data=data, **kwargs)
  File "/opt/test/ve/lib/python2.7/site-packages/requests/api.py", line 123, in put
    return request('put', url, data=data, **kwargs)
  File "/opt/test/ve/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/test/ve/lib/python2.7/site-packages/requests/sessions.py", line 457, in request
    prep = self.prepare_request(req)
  File "/opt/test/ve/lib/python2.7/site-packages/requests/sessions.py", line 390, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/opt/test/ve/lib/python2.7/site-packages/requests/models.py", line 295, in prepare
    self.prepare_headers(headers)
  File "/opt/test/ve/lib/python2.7/site-packages/requests/models.py", line 409, in prepare_headers
    check_header_validity(header)
  File "/opt/test/ve/lib/python2.7/site-packages/requests/utils.py", line 756, in check_header_validity    "not %s" % (value, type(value)))
InvalidHeader: Header value 1800 must be of type str or bytes, not <type 'int'>

@ollandos
Copy link

ollandos commented Feb 2, 2017

Facing the same issue here. Any workaround?

@drewbrew
Copy link
Collaborator

Do you still see this with requests 2.21?

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

3 participants