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.contentis now aiohttp's ownStreamReader, both when recording and on replay.iter_any()anditer_chunks()work, lines over 64 KiB are no longer refused, andreaduntil(),is_eof(),total_bytesand 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_parameterscrashing withUnicodeDecodeErroron binary request bodies passed asbytesorbytearray, 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 withTypeError: 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