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

not compatible with requests-cache #881

Open
jedie opened this issue Nov 12, 2024 · 0 comments
Open

not compatible with requests-cache #881

jedie opened this issue Nov 12, 2024 · 0 comments

Comments

@jedie
Copy link

jedie commented Nov 12, 2024

Recording ends with:

  File "/root/.local/share/virtualenvs/foobar/lib/python3.11/site-packages/requests_cache/session.py", line 183, in request
    return super().request(method, url, *args, headers=headers, **kwargs)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/foobar/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/foobar/lib/python3.11/site-packages/requests_cache/session.py", line 230, in send
    response = self._send_and_cache(request, actions, cached_response, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/foobar/lib/python3.11/site-packages/requests_cache/session.py", line 258, in _send_and_cache
    self.cache.save_response(response, actions.cache_key, actions.expires)
  File "/root/.local/share/virtualenvs/foobar/lib/python3.11/site-packages/requests_cache/backends/base.py", line 98, in save_response
    cached_response = CachedResponse.from_response(response, expires=expires)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/foobar/lib/python3.11/site-packages/requests_cache/models/response.py", line 109, in from_response
    obj.raw = CachedHTTPResponse.from_response(response)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/foobar/lib/python3.11/site-packages/requests_cache/models/raw_response.py", line 56, in from_response
    kwargs['request_url'] = response.raw._request_url
                            ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'VCRHTTPResponse' object has no attribute '_request_url'

Related code parts: https://github.com/requests-cache/requests-cache/blob/4263964a51f6d8317c6c5b4ba2da4a29c24e85d7/requests_cache/models/raw_response.py#L74-L81

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

1 participant