[issue42037] Documentation confusion in CookieJar functions

Markus Israelsson report at bugs.python.org
Wed Oct 14 11:23:42 EDT 2020


New submission from Markus Israelsson <markus.israelsson at surgicalscience.com>:

The documentation in https://docs.python.org/3.8/library/http.cookiejar.html#http.cookiejar.CookieJar
claims the following for functions add_cookie_header and extract_cookies.

***
The request object (usually a urllib.request.Request instance) must support the methods get_full_url(), get_host(), get_type(), unverifiable(), has_header(), get_header(), header_items(), add_unredirected_header() and origin_req_host attribute as documented by urllib.request.
***


When reading the documentation for Request Objects https://docs.python.org/3.8/library/urllib.request.html?highlight=requests#request-objects
there is this:
***
Changed in version 3.4: The request methods add_data, has_data, get_data, get_type, get_host, get_selector, get_origin_req_host and is_unverifiable that were deprecated since 3.3 have been removed.
***

So basically the documentation claims that if the request object does not support functions that are removed then the headers will not be added. The code itself seem to do the correct thing however and add the header.

----------
assignee: docs at python
components: Documentation
messages: 378624
nosy: docs at python, markus
priority: normal
severity: normal
status: open
title: Documentation confusion in CookieJar functions
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42037>
_______________________________________


More information about the Python-bugs-list mailing list