kennethreitz/requests — pull request #565 by slingamn (2012-04-25 07:58:50+00:00)
Title: Support CookieJar, references #281

This is my update of dhagrow's branch. It makes the backing store for cookies be a `CookieJar`, and adds compatibility with passed-in `CookieJar` subclasses like `LWPCookieJar`.

The default `CookieJar` implementation is compatible with existing code that expects `response.cookies` to be a dict.

This branch is complete to the best of my knowledge, but I haven't tested it against Python 3.x, since the current `develop` branch is broken against 3.x. I thought about trying to fix it but this change is confusing enough already :-)

I would appreciate suggestions for additional tests :-)

````
Traceback (most recent call last):
File "./test_requests_https.py", line 10, in
import requests
File "/home/shivaram/workspace/requests/requests/__init__.py", line 25, in
from . import utils
File "/home/shivaram/workspace/requests/requests/utils.py", line 476, in
_unreserved_hextochr = dict((binascii.b2a_hex(c), c) for c in _unreserved_set)
File "/home/shivaram/workspace/requests/requests/utils.py", line 476, in
_unreserved_hextochr = dict((binascii.b2a_hex(c), c) for c in _unreserved_set)
TypeError: 'str' does not support the buffer interface
````