someone stole the cookie jar
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 fa2f1c5 · Browse files · 1 file·+9 added−8 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+9 added−8 removed
- other:+9 added−8 removed
Provenance
- Commit
a67cc5c- Tree
0c9dacc- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
fa2f1c5
1 file changed+9 added−8 removed
modified:requests/core.py+9 added-8 removed
109 unmodified lines110 """Creates appropriate opener object for urllib2."""111 112 _handlers = []113 114- if self.cookiejar != None:114+ if self.cookiejar:115 _handlers.append(urllib2.HTTPCookieProcessor(self.cookiejar))116 117 if self.auth:118 if not isinstance(self.auth.handler, (urllib2.AbstractBasicAuthHandler, urllib2.AbstractDigestAuthHandler)):69 unmodified lines188 try:189 opener = self._get_opener()190 resp = opener(req)191 192- if self.cookiejar != None:192+ if self.cookiejar:193 self.cookiejar.extract_cookies(resp, req)194+ 195 except urllib2.HTTPError, why:196 self._build_response(why)197 self.response.error = why198 else:213 unmodified lines412 """413 data = kwargs.pop('data', dict()) or kwargs.pop('params', dict())414 415 r = Request(method=method, url=url, data=data, headers=kwargs.pop('headers', {}),415- cookiejar=kwargs.pop('cookiejar', None), files=kwargs.pop('files', None),416+ cookiejar=kwargs.pop('cookies', None), files=kwargs.pop('files', None),417 auth=kwargs.pop('auth', auth_manager.get_auth(url)))418 r.send()419 420 return r.response8 unmodified lines429 :param cookies: (optional) CookieJar object to send with the :class:`Request`.430 :param auth: (optional) AuthObject to enable Basic HTTP Auth.431 """432 432- return request('GET', url, params=params, headers=headers, cookiejar=cookies, auth=auth)433+ return request('GET', url, params=params, headers=headers, cookies=cookies, auth=auth)434 435 436 def head(url, params={}, headers={}, cookies=None, auth=None):437 """Sends a HEAD request. Returns :class:`Response` object.4 unmodified lines442 :param cookies: (optional) CookieJar object to send with the :class:`Request`.443 :param auth: (optional) AuthObject to enable Basic HTTP Auth.444 """445 445- return request('HEAD', url, params=params, headers=headers, cookiejar=cookies, auth=auth)446+ return request('HEAD', url, params=params, headers=headers, cookies=cookies, auth=auth)447 448 449 def post(url, data={}, headers={}, files=None, cookies=None, auth=None):450 """Sends a POST request. Returns :class:`Response` object.5 unmodified lines456 :param cookies: (optional) CookieJar object to send with the :class:`Request`.457 :param auth: (optional) AuthObject to enable Basic HTTP Auth.458 """459 459- return request('POST', url, data=data, headers=headers, files=files, cookiejar=cookies, auth=auth)460+ return request('POST', url, data=data, headers=headers, files=files, cookies=cookies, auth=auth)461 462 463 def put(url, data='', headers={}, files={}, cookies=None, auth=None):464 """Sends a PUT request. Returns :class:`Response` object.5 unmodified lines470 :param cookies: (optional) CookieJar object to send with the :class:`Request`.471 :param auth: (optional) AuthObject to enable Basic HTTP Auth.472 """473 473- return request('PUT', url, data=data, headers=headers, files=files, cookiejar=cookies, auth=auth)474+ return request('PUT', url, data=data, headers=headers, files=files, cookies=cookies, auth=auth)475 476 477 def delete(url, params={}, headers={}, cookies=None, auth=None):478 """Sends a DELETE request. Returns :class:`Response` object.4 unmodified lines483 :param cookies: (optional) CookieJar object to send with the :class:`Request`.484 :param auth: (optional) AuthObject to enable Basic HTTP Auth.485 """486 486- return request('DELETE', url, params=params, headers=headers, cookiejar=cookies, auth=auth)487+ return request('DELETE', url, params=params, headers=headers, cookies=cookies, auth=auth)488 489 490 491 class RequestException(Exception):11 unmodified lines