This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: CookieJar expects request objects with origin_req_host attribute instead of method
Type: behavior Stage: patch review
Components: Documentation, Library (Lib) Versions: Python 3.3, Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: docs@python, orsenthil, python-dev, sinic
Priority: normal Keywords: patch

Created on 2013-05-18 15:45 by sinic, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
18007.patch orsenthil, 2013-05-22 06:09 review
Messages (5)
msg189523 - (view) Author: Simon Nicolussi (sinic) Date: 2013-05-18 15:45
A fix for a DeprecationWarning (#17678) had the unfortunate side effect of changing the expected interface of the request object higher up in the call stack.

For example, the documentation for CookieJar.add_cookie_header(request) states that the request object must support the methods get_full_url(), get_host(), get_type(), unverifiable(), get_origin_req_host(), has_header(), get_header(), header_items(), and add_unredirected_header(). The patch for #17678, however, changes the requirement for a get_origin_req_host() method to an origin_req_host attribute.

This breaks at least one notable third-party library (Kenneth Reitz' Requests).
msg189774 - (view) Author: Simon Nicolussi (sinic) Date: 2013-05-21 17:48
Requests 1.2.1 has been released to address this issue. An origin_req_host property has been added to the request object as a workaround.

The original problem of mismatched documentation and behaviour still persists.
msg189792 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2013-05-22 06:09
Hello Simon,

Thanks for bringing this to attention. Since get_origin_req_host has been under deprecation was a release, I thought it was safe to remove that. Agree that documentation of "cookiejar" methods, which had a dependency on the change should have been fixed.

Here is patch attempting to do that. If this is okay, I shall go with committing this change in 3.3 and 3.4.
msg189863 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-23 12:28
New changeset 26ac5b9cffda by Senthil Kumaran in branch '3.3':
Fix #18007 : Document CookieJar.add_cookie_header request parameter changes in 3.3

New changeset f7992397e98d by Senthil Kumaran in branch 'default':
merge from 3.3
msg189864 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2013-05-23 12:29
This change is documented. Thanks for the report.
Date User Action Args
2022-04-11 14:57:45adminsetgithub: 62207
2013-05-23 12:29:15orsenthilsetstatus: open -> closed
resolution: fixed
messages: + msg189864
2013-05-23 12:28:39python-devsetnosy: + python-dev
messages: + msg189863
2013-05-22 06:09:53orsenthilsetfiles: + 18007.patch
versions: + Python 3.4
messages: + msg189792

assignee: docs@python -> orsenthil
keywords: + patch
stage: patch review
2013-05-21 17:48:48sinicsetmessages: + msg189774
2013-05-18 15:45:02siniccreate