Bug 994602
Summary: | AttributeError: 'MockRequest' object has no attribute 'origin_req_host' | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jim Minter <jminter> |
Component: | python-requests | Assignee: | Arun S A G <sagarun> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 19 | CC: | rbean, sagarun |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-09-23 18:58:53 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jim Minter
2013-08-07 15:08:11 UTC
For visitors looking for an insecure hack to work around this, try adding the following code to your application: # https://github.com/kennethreitz/requests/issues/1379 import http.cookiejar http.cookiejar.is_third_party = lambda request: False Sure, let's give it a try. So many things rely on python-requests... I'll try to let it sit in updates-testing a little longer than usual. python-requests-1.2.3-2.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/python-requests-1.2.3-2.fc19 Oh dear, this isn't good. Trying python3-requests-1.2.3-2.fc19, I've found that it's not automatically un-gzipping content received from remote servers like it used to. Given (as Ralph mentioned) the number of people relying on python-requests, I think that's a show-stopper. The issue is down to a combination of: (a) commit https://github.com/kennethreitz/requests/commit/59f916ca4a6a8e55528988cfc1bee445e71c4602 removing functionality in favour of using urllib3 instead, and (b) the replacement urllib3 functionality being broken in the version of urllib3 that we currently ship. Specifically, in HTTPResponse.read(), ... if amt is None: # cStringIO doesn't like amt=None data = self._fp.read() else: return self._fp.read(amt) try: if decode_content and decoder: data = decoder(data) except (IOError, zlib.error): ... the return statement shouldn't be there as it prevents the gzip decoder from running. This is fixed upstream (I've checked that python3-pip install --upgrade urllib3 makes things act as expected). I'd now suggest the following: - for F20, rebase python3-requests /and/ python3-urllib to latest upstream - for F19, reject python3-requests-1.2.3-2, and do one of the following, depending on appetite for risk: - rebase python3-requests /and/ python3-urllib to latest upstream, OR - try rebasing python3-requests ONLY to 1.2.1 or 1.2.2 (thus missing the commit mentioned above), OR - do nothing! Well, as long as the updates for python3-requests and python3-urllib go out together.. and as long as we keep them in updates-testing for a hefty amount of time: I think I'm ok with updating them both to the latest upstream in F19. python-urllib3-1.7-1.fc19,python-requests-1.2.3-3.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/python-urllib3-1.7-1.fc19,python-requests-1.2.3-3.fc19 Tested and all works for me -- thanks! I wonder if it might be worth putting Requires: python-urllib3 >= 1.7 and Requires: python3-urllib3 >= 1.7 in the relevant parts of the requests spec file? Yes, that sounds smart. python-urllib3-1.7-2.fc19,python-requests-1.2.3-4.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/python-urllib3-1.7-2.fc19,python-requests-1.2.3-4.fc19 python-requests-1.2.3-5.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/python-requests-1.2.3-5.fc19 python-urllib3-1.7-3.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/python-urllib3-1.7-3.fc19 All works for me. I'll report back if I encounter any issues with the new RPMs. Thanks again. python-urllib3-1.7-3.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report. python-requests-1.2.3-5.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report. |