Prior to this, you could sneak a list of anything to register_hook and it
would accept it. This will check if the items in the list are callable before
registering them. Also added a regression test to make sure if this gets
changed it will be noticed.
Prior to this, you could sneak a list of anything to register_hook and it
would accept it. This will check if the items in the list are callable before
registering them. Also added a regression test to make sure if this gets
changed it will be noticed.
After #831, the tests added in #764 (which relied on iter_content()
crashing if the response was prefetched) no longer tested what they
were intended to test.
This allows iter_content and iter_lines to succeed without
crashing even after the response content has been fetched
(iter_content gives you an iterator over the prefetched
content)
I wasn't thorough enough with how I dealt with headers. Most of the header
logic in the Request object utilizes dictionary properties which will not work
with a key/value list.
I'll dig more into this, but I know the rest of the features are more
important so I'll take my time on this and send a separate pull request.
* Properly handle repeated data fields for multipart/form-data requests (#737)
* Allow a list of 2-tuples as the `files` agument.
* Consistently serialize lists a of parameters (#729).
* prefetch now defaults to True, ensuring that by default, sockets
are returned to the urllib3 connection pool on request end
* sessions now have a close() method, notifying urllib3 to close pooled
connections
* the module-level API, e.g., `requests.get('http://www.google.com')`,
explicitly closes its session when finished
When prefetch is False, the open socket becomes part of the state of the
Response object, and it's the client's responsibility to read the whole
body, at which point the socket will be returned to the pool.
Bound the name builtin_str to __builtin__.str and added another check
for this class since the str class was rebound to unicode in compat.
This issue was only for Python 2 as well.