What's Changed
SOCKS proxies
Requests made through SOCKS proxies with requests and urllib3 (socks5:// and socks5h://, with PySocks installed) are now recorded and played back. urllib3 uses its own connection classes for them, which vcrpy didn't patch, so these requests skipped the cassette entirely (#547, #548, #1087).
Multipart form filtering
filter_post_data_parameters now filters the fields of multipart/form-data request bodies, e.g. requests.post(url, data={"api_key": ...}, files=...). Before, it treated them as urlencoded forms and didn't find their fields, so their values were recorded (#521, #1090).
If you match on body: requests are filtered before they're matched, so cassettes recorded with unfiltered multipart bodies need re-recording.
Fixes
- Fix requests escaping a cassette, e.g. a write-protected one not raising
CannotOverwriteExistingCassetteException, when avcr.patch.force_reset()window opened elsewhere is closed late by the garbage collector while the cassette is in use (#979, #1051, #1088) - thanks @yeion7, from #1052 - Fix
AttributeError: 'str' object has no attribute 'get_all'when requests builds a response from aurllib.requestresponse, e.g. withHTTPAdapter.build_response()(#956, #1089)
Full Changelog: v9.3.2...v9.4.0