cookiejar => cookies in models
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Kenneth Reitz · committed by Kenneth Reitz · parent d72d116 · Browse files · 1 file·+10 added−10 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+10 added−10 removed
- other:+10 added−10 removed
Provenance
- Commit
f269c6c- Tree
f229ec1- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
d72d116
1 file changed+10 added−10 removed
modified:requests/models.py+10 added-10 removed
22 unmodified lines23 from .packages.poster.encode import multipart_encode24 from .packages.poster.streaminghttp import register_openers, get_handlers25 from .utils import dict_from_cookiejar, get_unicode_from_response, stream_decode_response_unicode, decode_gzip, stream_decode_gzip26 from .status_codes import codes27-from .exceptions import RequestException, AuthenticationError, Timeout, URLRequired, InvalidMethod, TooManyRedirects27+from .exceptions import Timeout, URLRequired, TooManyRedirects28 29 30 REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)31 5 unmodified lines37 """38 39 def __init__(self,40 url=None, headers=dict(), files=None, method=None, data=dict(),41- params=dict(), auth=None, cookiejar=None, timeout=None, redirect=False,41+ params=dict(), auth=None, cookies=None, timeout=None, redirect=False,42 allow_redirects=False, proxies=None, hooks=None):43 44 #: Float describes the timeout of the request.45 # (Use socket.setdefaulttimeout() as fallback)44 unmodified lines90 #: :class:`AuthObject` to attach to :class:`Request <Request>`.91 self.auth = auth92 93 #: CookieJar to attach to :class:`Request <Request>`.94- self.cookiejar = cookiejar94+ self.cookies = cookies95 96 #: True if Request has been sent.97 self.sent = False98 32 unmodified lines131 """Creates appropriate opener object for urllib2."""132 133 _handlers = []134 135- if self.cookiejar is not None:136- _handlers.append(urllib2.HTTPCookieProcessor(self.cookiejar))135+ if self.cookies is not None:136+ _handlers.append(urllib2.HTTPCookieProcessor(self.cookies))137 138 if self.auth:139 if not isinstance(self.auth.handler,140 (urllib2.AbstractBasicAuthHandler,49 unmodified lines190 try:191 response.headers = CaseInsensitiveDict(getattr(resp.info(), 'dict', None))192 response.raw = resp193 194- if self.cookiejar:195- response.cookies = dict_from_cookiejar(self.cookiejar)194+ if self.cookies:195+ response.cookies = dict_from_cookiejar(self.cookies)196 197 198 except AttributeError:199 pass43 unmodified lines243 method = self.method244 245 request = Request(246 url, self.headers, self.files, method,247- self.data, self.params, self.auth, self.cookiejar,247+ self.data, self.params, self.auth, self.cookies,248 redirect=True249 )250 request.send()251 r = request.response111 unmodified lines363 if settings.timeout_fallback:364 # restore global timeout365 socket.setdefaulttimeout(old_timeout)366 367- if self.cookiejar is not None:368- self.cookiejar.extract_cookies(resp, req)367+ if self.cookies is not None:368+ self.cookies.extract_cookies(resp, req)369 370 except (urllib2.HTTPError, urllib2.URLError), why:371 if hasattr(why, 'reason'):372 if isinstance(why.reason, socket.timeout):307 unmodified lines