VCR.py doesn't work well with subclasses of HTTPSConnection
See original GitHub issueProject I’m working on uses chargebee python client. I decided to give VCR.py a try and instantly got this exception:
File "/project/path/code.py", line 23, in validate_chargebee_id
chargebee.Customer.retrieve(value)
File "/venv/path/lib/python3.4/site-packages/chargebee/models/customer.py", line 29, in retrieve
return request.send('get', request.uri_path("customers",id), None, env, headers)
File "/venv/path/lib/python3.4/site-packages/chargebee/request.py", line 14, in send
response = http.request(method, url, env, ser_params, headers)
File "/venv/path/lib/python3.4/site-packages/chargebee/http.py", line 34, in request
connection = compat.VerifiedHTTPSConnection(meta.netloc)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1203, in __init__
super(HTTPSConnection, self).__init__(host, port, timeout,
TypeError: super(type, obj): obj must be an instance or subtype of type
By searching issues I’ve found the same exception in https://github.com/kevin1024/vcrpy/issues/183, but not sure if it’s because of the same reason, hope someone more familiar with VCR.py code can tell how to fix that.
VerifiedHTTPSConnection
is defined here
MRO of classes at the moment of failure:
ipdb> HTTPSConnection.__mro__
(<class 'vcr.patch.VCRHTTPSConnectioncassettes/test_webhook_events/test_add_charge'>, <class 'vcr.stubs.VCRHTTPSConnection'>, <class 'vcr.stubs.VCRConnection'>, <class 'object'>)
ipdb> self.__class__.__mro__
(<class 'chargebee.compat.VerifiedHTTPSConnection'>, <class 'http.client.HTTPSConnection'>, <class 'http.client.HTTPConnection'>, <class 'object'>)
Python 3.4.3 vcrpy==1.7.4 chargebee==1.5.4
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
vcr.patch — vcrpy 4.2.1 documentation
HTTPSConnection # Try to save the original types for boto3 try: from ... This behavior is necessary to properly support nested cassette contexts....
Read more >The Best Ways to Organize Your Files with Tags and Labels
How to organize your files, photos, emails, and more with a tagging system.
Read more >Understanding the Connection Types for Your TV, Internet and ...
Identify multiple ways to connect to your television, home theatre or audio system.
Read more >Connect a device to the Android TV/Google TV VIDEO IN jack ...
If not supplied with your TV, purchase the correct cable. Go to Parts and Accessories. Connect the 3.5 mm mini-jack of the RCA...
Read more >RFC 5545: Internet Calendaring and Scheduling Core Object ...
Network Working Group B. Desruisseaux, Ed. Request for Comments: 5545 ... While the iCalendar object is not a profile of the text/directory media...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m having exactly the same issue while trying to use VCR.py along with PyGithub.
I’m having a similar issue when using VCRpy to test some ofxclient calls.
Dropping a breakpoint in
__init__
ofHTTPSConnection
, I see:I am using:
So I think the issue persists, if the same thing is going on here. I don’t seem to have rights to re-open, but I can add a new if needed.