Skip to content

Commit

Permalink
Fixed missing version_string attribute when used with urllib3>=2.3.0
Browse files Browse the repository at this point in the history
urllib3 in v2.3.0 introduced attribute `version_string` (https://github.com/urllib3/urllib3/pull/3316/files). This attribute  is missing in `VCRHTTPResponse` which causes errors like AttributeError: 'VCRHTTPResponse' object has no attribute 'version_string'

This fixes #888
  • Loading branch information
exslim authored and jairhenrique committed Dec 28, 2024
1 parent 5b858b1 commit 48d0a2e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vcr/stubs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(self, recorded_response):
self.reason = recorded_response["status"]["message"]
self.status = self.code = recorded_response["status"]["code"]
self.version = None
self.version_string = None
self._content = BytesIO(self.recorded_response["body"]["string"])
self._closed = False
self._original_response = self # for requests.session.Session cookie extraction
Expand Down

0 comments on commit 48d0a2e

Please sign in to comment.