-
Notifications
You must be signed in to change notification settings - Fork 388
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
Test failures with Python 3.12.0b1:AttributeError: type object 'VCRHTTPConnection[…]' has no attribute 'debuglevel' #707
Comments
The following cheap hack seems to resolve it: diff --git a/vcr/stubs/__init__.py b/vcr/stubs/__init__.py
index 54ce470..3e0b21b 100644
--- a/vcr/stubs/__init__.py
+++ b/vcr/stubs/__init__.py
@@ -171,6 +171,8 @@ class VCRHTTPResponse(HTTPResponse):
class VCRConnection:
# A reference to the cassette that's currently being patched in
cassette = None
+ debuglevel = HTTPSConnection.debuglevel
+ _http_vsn = HTTPSConnection._http_vsn
def _port_postfix(self):
""" However, there is probably a better way of resolving this. |
Gentle ping. |
@mgorny can you help us by submitting a PR with python 3.12 support in CI? |
mgorny
added a commit
to mgorny/vcrpy
that referenced
this issue
Aug 3, 2023
Copy the `debuglevel` and `_http_vsn` attributes from base connection class into response classes, in order to fix compatibility with Python 3.12. For reasons I don't comprehend, these end up being called on the class rather than instance, so regular proxying logic does not work. Fixes kevin1024#707
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running the test suite against Python 3.12.0b1, I get a lot of failures from integration tests, they seem to roughly boil down to the same thing:
I'm guessing that
__getattr__()
doesn't work here (because stuff's being called from a "type object"?).Full log: py312.log
The text was updated successfully, but these errors were encountered: