1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Fixed missing version_string attribute when used with urllib3>=2.3.0

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 https://github.com/kevin1024/vcrpy/issues/888
This commit is contained in:
Igor Gumenyuk
2024-12-23 18:48:22 +02:00
committed by Jair Henrique
parent 5b858b132d
commit 48d0a2e453

View File

@@ -66,6 +66,7 @@ class VCRHTTPResponse(HTTPResponse):
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