You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you pass a generator to data in requests it will iterate over the generator and include that info into the request. This has the result of draining the provided iterator. Currently we don't do this, nor do we read provided files.
It's rare this would be something that an application is testing the result of. The provided case is that swiftclient updates the md5sum as the iterator is read which is currently not happening.
The downside of this is that the body available in last_request is now expended. Again this probably doesn't matter but it's a change in behaviour.
Using itertools.tee we can both drain the generator and maintain the request history - but i'm not sure it's worth it.
Another consequence of this is that last_request.text returns the generator instead of the resulting text, which is a much more common thing people would want to check.
That can be worked around with e.g. bytes(itertools.chain(*mock.last_request.text)).decode('utf8')
If you pass a generator to data in requests it will iterate over the generator and include that info into the request. This has the result of draining the provided iterator. Currently we don't do this, nor do we read provided files.
It's rare this would be something that an application is testing the result of. The provided case is that swiftclient updates the md5sum as the iterator is read which is currently not happening.
The downside of this is that the body available in last_request is now expended. Again this probably doesn't matter but it's a change in behaviour.
Using itertools.tee we can both drain the generator and maintain the request history - but i'm not sure it's worth it.
Launchpad Details: #LP1616751 Jamie Lennox - 2016-08-25 06:19:58 +0000
The text was updated successfully, but these errors were encountered: