Matching on bodies uses urllib.parse.parse_qs(), which fails to handle
UTF-8+URLEncoded POST bodies when the input is `bytes` rather than `str`,
causing matching to fail..
Fixed this by always doing decode('ascii') on URLEncoded POST bodies first.
Aiohttp expects an awaitable instance to be returned from
`ClientSession._request` though `asyncio.coroutine` decorated function
do not implement `__await__`. By changing the syntax and dropping Python
3.4 support we fix this issue.
When no cassette exists, it's expected that the response returned, should be
the original, unchanged response. The response recorded in the cassette should be
that which is returned by the before_record_response callback.
But on subsequent requests/responses (when a cassette exists), the responses
returned should be exactly what is in the cassette.
resolves#355
Whilst working on the Reproducible Builds effort [0], we noticed
that vcrpy could not be built reproducibly.
This is due to the documentation including the absolute build path
via Python default arguments.
This was originally filed in Debian as #895269 [1].
[0] https://reproducible-builds.org/
[1] https://bugs.debian.org/895269
Signed-off-by: Chris Lamb <lamby@debian.org>
The new version of requests un-vendors urllib3, with a nifty hack:
https://github.com/kennethreitz/requests/blob/master/requests/packages.py
Unfortunately messing directly with sys.modules causes some weird
behavior that I don't entirely understand. Avoiding the extra import to
requests.packages as part of VCR's initialization seems to sidestep the
issue.
Closes#311
find_packages(exclude=) only works with packages, not modules.
So this fixes install_lib for python2 by correctly excluding that module.
Fixes: #270Fixes: #271
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>