unstale

pypi / vcrpy

vcrpy

What changed in vcrpy 7 to 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

13 breaking2 security14 new APIs and options7 behavior and defaults45 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

vcrpy 942 changes

Breaking changes 6

  • The filter now filters multipart/form-data request fields; requests are filtered before matching, so cassettes recorded with unfiltered multipart bodies need re-recording when matching on body.

    9.4.0release notes

  • Using use_cassette() without a path as a context manager now raises a clear TypeError; a path may be omitted only when decorating a function.

    9.3.2release notes

  • Runs when a cassette is loaded as well, so the callback should be idempotent.

    9.3.0release notes

  • A missing metadata key raises this error when the record mode does not allow changing the cassette.

    9.3.0release notes

  • The filter now filters request bodies for every HTTP method, not just POST; re-record cassettes with unfiltered PUT, PATCH, or DELETE bodies if matching on body.

    9.0.0release notes

  • Python 3.11 or later is required; on Python 3.10, pip continues installing vcrpy 8.x.

    9.0.0release notes

Security 1

  • Replaces sensitive values with placeholders when cassettes are saved and restores them when loaded, so secrets stay out of cassette files while requests still match.

    9.2.0release notes

New APIs and options 9

  • While recording, a request matching one already recorded gets the recorded response instead of being sent and recorded again.

    9.3.0release notes

  • Opt in to filtering keys in nested objects of JSON request bodies when using filter_post_data_parameters.

    9.3.0release notes

  • Cassette metadata can store values that are not part of an interaction and return the stored value during playback.

    9.3.0release notes

  • Adds a hook that receives each interaction when a cassette is loaded and can return a changed interaction or None to leave it out.

    9.2.0release notes

  • Adds a hook that receives each interaction when a cassette is saved and can return a changed interaction or None to leave it out.

    9.2.0release notes

  • Cassettes expose a new read-only path property.

    9.2.0release notes

  • use_cassette accepts a persister option to use a custom persister for one cassette.

    9.1.0release notes

  • A new reason attribute provides a sturdier value to check than matching the exception message text.

    9.0.0release notes

  • Use this new function to replace body parameters for any HTTP method.

    9.0.0release notes

Behavior and default changes 6

  • Requests through socks5:// and socks5h:// proxies with requests and urllib3 are now recorded and played back when PySocks is installed.

    9.4.0release notes

  • Responses to unrecorded requests are no longer read by vcrpy, allowing their bodies to stream as usual.

    9.3.0release notes

  • Accepts compiled regular expressions that match whole host names.

    9.3.0release notes

  • Cassette paths and cassette_library_dir now accept pathlib.Path and other path-like objects.

    9.1.0release notes

  • ignore_localhost now also ignores the IPv6 localhost address ::1.

    9.1.0release notes

  • The exception message now explains what went wrong, shows how the closest recorded requests differ, and suggests how to fix it.

    9.0.0release notes

Fixes and other changes 20

  • Responses return connections to urllib3 pools after their bodies are read, preventing sessions with pool_block=True from waiting forever across cassette boundaries.

    9.4.2release notes

  • use_cassette() no longer raises ImportError while building patchers with urllib3 1.x, allowing recordings to proceed.

    9.4.1release notes

  • Fixes an AttributeError when requests builds a response from a urllib.request response.

    9.4.0release notes

  • Requests no longer escape a cassette when a force_reset window opened elsewhere is closed late by garbage collection while the cassette is in use.

    9.4.0release notes

  • Filtering post data no longer crashes on iterator request bodies such as generators; like file bodies, they are left unfiltered.

    9.3.2release notes

  • HTTPS requests played back from a cassette no longer open a real connection or perform a TLS handshake in new_episodes mode.

    9.3.2release notes

  • A warning is logged when a cassette file exists but can't be decoded, instead of silently treating it as empty where recording could overwrite it.

    9.3.1release notes

  • Request can now be imported from vcr.

    9.3.1release notes

  • With allow_playback_repeats set, no longer saves an interaction once per playback.

    9.3.0release notes

  • An empty cassette file is recorded like a missing one instead of causing TypeError or JSONDecodeError.

    9.3.0release notes

  • Calling release_conn() on a streamed urllib3 response returns its connection to the pool.

    9.3.0release notes

  • The body matcher no longer crashes on form-urlencoded and XML-RPC requests without a body.

    9.1.0release notes

  • The filter now matches urlencoded parameter names, including names represented with percent-encoding.

    9.1.0release notes

  • Replayed urllib3 responses now have json(), matching urllib3 2.x responses.

    9.1.0release notes

  • Replayed aiohttp responses now expose raw_headers, allowing code that reads them to work on replay.

    9.1.0release notes

  • Replayed urllib3 responses now provide release_conn() for code that releases pooled responses.

    9.1.0release notes

  • The response stream is closed if reading an httpx response fails during recording.

    9.1.0release notes

  • The body matcher no longer crashes when a body does not parse as its declared content type.

    9.0.0release notes

  • urllib3 and requests responses now have HTTPHeaderDict headers, preserving repeated header values.

    9.0.0release notes

  • aiohttp error responses are recorded when raise_for_status is used on the session or request, and replaying them raises as aiohttp does.

    9.0.0release notes

vcrpy 836 changes

Breaking changes 6

  • Recording and replay now use aiohttp's own StreamReader, so streaming reads work correctly and its full API is available.

    8.5.0release notes

  • Re-recording in all mode replaces every previously recorded interaction matching a new one under match_on; with drop_unused_requests=True, the cassette contains only what was just recorded.

    8.4.0release notes

  • File-like or iterator request bodies are forwarded with Content-Length instead of chunked encoding, which some servers reject.

    8.4.0release notes

  • Recording fails fast when a request or response contains a Python object the safe YAML loader cannot read back, rather than writing a cassette that breaks on replay.

    8.3.0release notes

  • Support for Python 3.9 has been dropped.

    8.0.0release notes

  • Support for urllib3 versions below 2 has been dropped.

    8.0.0release notes

Security 1

  • Cassettes are loaded with a safe YAML loader, preventing arbitrary code execution from untrusted cassettes while preserving support for existing cassettes.

    8.2.1release notessecurity advisory

New APIs and options 5

  • vcrpy adds support for niquests.

    8.3.0release notes

  • Builds a YAML serializer that supports custom Python object tags during recording and replay; register it per VCR instance with register_serializer.

    8.3.0release notes

  • Adds support for httpx 2.x.

    8.2.0release notes

  • Makes the request URL available on VCRHTTPResponse.

    8.2.0release notes

  • This new option removes unused interactions from cassettes.

    8.0.0release notes

Behavior and default changes 1

  • VCR.py can decompress Brotli responses when brotli, brotlipy, or brotlicffi is available.

    8.1.0release notes

Fixes and other changes 23

  • Recording aiohttp requests that upload an open file as a form field no longer crashes; the file's contents are recorded and the whole file is still sent.

    8.5.0release notes

  • Recording aiohttp requests whose body is an async generator, such as a streaming upload, no longer fails.

    8.5.0release notes

  • Binary request bodies passed as bytes or bytearray are left untouched, and form segments without an = are no longer mangled.

    8.5.0release notes

  • Python 3.14 and 3.15, including their free-threaded builds, are supported.

    8.5.0release notes

  • Replay no longer crashes on cassettes that store a null reason phrase; the fix also applies to httpx2.

    8.4.0release notes

  • Bare-host URLs now match cassettes that recorded the same URL with a trailing slash; otherwise the matcher remains as strict as before.

    8.4.0release notes

  • Fixes an AttributeError when niquests reuses a pooled connection with urllib3-future 2.25.901 or later.

    8.4.0release notes

  • Fixes stale keep-alive connection reuse across cassettes.

    8.3.0release notes

  • Errors are clearer when a cassette contains an unsupported YAML tag.

    8.3.0release notes

  • Invalid record_mode values are validated and raise a clear error.

    8.2.1release notes

  • Fixes compatibility with aiohttp 3.14.

    8.2.0release notes

  • Uses an explicit type check for the body check.

    8.2.0release notes

  • Accounts for modified requests when storing played cassettes, so drop_unused_requests honours before_record_request filtering.

    8.2.0release notes

  • Improves the error message when a matching request has already been consumed.

    8.2.0release notes

  • Fixed sync requests in async contexts for HTTPX.

    8.1.1release notes

  • Fixes aiohttp allowing both data and json arguments when one is None.

    8.1.0release notes

  • Fixes usage of an io-like interface with VCR.py.

    8.1.0release notes

  • Custom httpx transports are now supported.

    8.0.0release notes

  • Fixes a KeyError for follow_redirects.

    8.0.0release notes

  • Proxy addresses no longer end up in cassette URIs.

    8.0.0release notes

  • Fixes httpx.ResponseNotRead exceptions.

    8.0.0release notes

  • httpx support now patches httpcore instead of httpx.

    8.0.0release notes

  • Fixes the deprecation warning on Python 3.14.

    8.0.0release notes

vcrpy 73 changes

Breaking changes 1

Fixes and other changes 2

  • A bug involving asyncio.run was fixed.

    7.0.0release notes

  • Fixed a missing version_string issue for urllib2>=2.3.0.

    7.0.0release notes