github kevin1024/vcrpy v8.5.0

latest releases: v9.2.0, v9.1.0, v9.0.0...
5 hours ago

What's Changed

aiohttp streaming

  • Streaming a response body from response.content (read(), iter_chunked(), readline() loops, ...) while recording no longer returns an empty body (#502)
  • readline() loops on replayed responses now reach the end of the body instead of restarting from the start on each access. This fixes the infinite loop when replaying google-genai streaming responses (#927)
  • response.content is now aiohttp's own StreamReader, both when recording and on replay. iter_any() and iter_chunks() work, lines over 64 KiB are no longer refused, and readuntil(), is_eof(), total_bytes and the rest of its API are available

All three are from #1055 — thanks @pylaterreur!

If your tests patch vcr.stubs.aiohttp_stubs to work around #502 or #927 (for example by overriding MockClientResponse.content, or by putting the recorded body back with unread_data()), remove the patch: it is no longer needed, and no longer works.

Other fixes

  • Fix filter_post_data_parameters crashing with UnicodeDecodeError on binary request bodies passed as bytes or bytearray, which are now left untouched, and stop it mangling form segments without a = (#660, #1039). Thanks @philsong4-ai
  • Fix recording aiohttp requests that upload an open file as a form field (data={"file": f}), which crashed with TypeError: cannot pickle '_io.BufferedReader' object. The file's contents are recorded and the whole file is still sent (#737, #1073). Thanks @LilSpazJoekp for the report
  • Fix recording aiohttp requests whose body is an async generator, e.g. a streaming upload (#974, #1069). Thanks @smoltafet

Python support

  • Support Python 3.14 and 3.15, and test them in CI along with their free-threaded builds, 3.14t and 3.15t (#940, #1058). Thanks @pylaterreur

Full Changelog: v8.4.0...v8.5.0

Don't miss a new vcrpy release

NewReleases is sending notifications on new releases.