Update reference to "cookielib" to "cookiejar" in documentation (#6214)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Alexandre Erwin Ittner · committed by GitHub · parent fecf3dc · Browse files · 1 file·+8 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+8 added−8 removed
- other:+8 added−8 removed
Provenance
- Commit
2ecdb68- Tree
1d33eef- Author
Alexandre Erwin Ittner <alexandre@ittner.com.br>- Committer
GitHub <noreply@github.com>- Parent
fecf3dc
1 file changed+8 added−8 removed
modified:requests/cookies.py+8 added-8 removed
1 """2 requests.cookies3 ~~~~~~~~~~~~~~~~4 5-Compatibility code to be able to use `cookielib.CookieJar` with requests.5+Compatibility code to be able to use `http.cookiejar.CookieJar` with requests.6 7 requests.utils imports from here, so be careful with imports.8 """9 12 unmodified lines22 23 class MockRequest:24 """Wraps a `requests.Request` to mimic a `urllib2.Request`.25 26- The code in `cookielib.CookieJar` expects this interface in order to correctly26+ The code in `http.cookiejar.CookieJar` expects this interface in order to correctly27 manage cookie policies, i.e., determine whether a cookie can be set, given the28 domains of the request and the cookie.29 30 The original request object is read-only. The client is responsible for collecting44 unmodified lines75 def get_header(self, name, default=None):76 return self._r.headers.get(name, self._new_headers.get(name, default))77 78 def add_header(self, key, val):79- """cookielib has no legitimate use for this method; add it back if you find one."""79+ """cookiejar has no legitimate use for this method; add it back if you find one."""80 raise NotImplementedError(81 "Cookie headers should be added with add_unredirected_header()"82 )83 19 unmodified lines103 class MockResponse:104 """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.105 106 ...what? Basically, expose the parsed HTTP headers from the server response107- the way `cookielib` expects to see them.107+ the way `http.cookiejar` expects to see them.108 """109 110 def __init__(self, headers):111- """Make a MockResponse for `cookielib` to read.111+ """Make a MockResponse for `cookiejar` to read.112 113 :param headers: a httplib.HTTPMessage or analogous carrying the headers114 """115 self._headers = headers7 unmodified lines123 124 def extract_cookies_to_jar(jar, request, response):125 """Extract the cookies from the response into a CookieJar.126 127- :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar)127+ :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)128 :param request: our own requests.Request object129 :param response: urllib3.HTTPResponse object130 """131 if not (hasattr(response, "_original_response") and response._original_response):41 unmodified lines173 """174 175 176 class RequestsCookieJar(cookielib.CookieJar, MutableMapping):177- """Compatibility class; is a cookielib.CookieJar, but exposes a dict177+ """Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict178 interface.179 180 This is the CookieJar we create by default for requests and sessions that181 don't specify one, since some clients may expect response.cookies and158 unmodified lines340 """341 self.set(name, value)342 343 def __delitem__(self, name):344- """Deletes a cookie given a name. Wraps ``cookielib.CookieJar``'s344+ """Deletes a cookie given a name. Wraps ``http.cookiejar.CookieJar``'s345 ``remove_cookie_by_name()``.346 """347 remove_cookie_by_name(self, name)348 213 unmodified lines