Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1214365

Summary: Update the version of python-requests that ships with 7.x to 2.6.x
Product: Red Hat Enterprise Linux 7 Reporter: Keith Robertson <kroberts>
Component: python-requestsAssignee: Python Maintainers <python-maint>
Status: CLOSED DUPLICATE QA Contact: Branislav NĂ¡ter <bnater>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: akrherz, hartsjc, isenfeld, jamills, jberan, jmoran, lmiksik, lsmid, mkosek, python-maint, richard.cunningham, sdodson, snagar, torsava
Target Milestone: rcKeywords: Rebase
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: python-requests-2.6.0-4.el7 Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-12 14:42:05 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:
Bug Depends On: 1226899, 1226901, 1226934, 1232882, 1232884, 1233112, 1233113    
Bug Blocks: 1181710, 1212207, 1232879    

Description Keith Robertson 2015-04-22 14:38:28 UTC
The BZ is intended to track the movement of the 'python-requests' RPM from the Common channel and into BaseOS.

Specifically, we require 2.6.0 so that it matches what is going in RHEL 6.7.0.

=== Related BZs ===
RHEL 6.7.0 BZ for python-requests 2.6.0: 
- BZ1176248

Justification for 2.6.0 and *no* earlier version: 
- https://bugzilla.redhat.com/show_bug.cgi?id=1207845#c5


=== Background ===
python-requests is such a useful package that it will benefit subscribers an other layered products.

=== INFO ===
python-requests is a modern replacement for the stock HTTP library that ships with python.  There are many many documented issues with the stock python HTTP library[1] and python-requests as done a fantastic job or addressing them.  Most python programmers are moving in this direction.


[1] http://docs.python-requests.org/en/latest/

Comment 1 Keith Robertson 2015-04-29 12:34:17 UTC
*** Bug 1168076 has been marked as a duplicate of this bug. ***

Comment 4 Keith Robertson 2015-05-26 15:50:03 UTC
It looks like python-requests already ships with RHEL 7.x[1].  Therefore, this BZ will be reworded so that it is clear that we are rebasing python-requests in RHEL 7.x to 2.6.x.

[1] https://brewweb.devel.redhat.com/buildinfo?buildID=322639

Comment 6 Scott Dodson 2015-07-06 15:48:56 UTC
This breaks my RHEL 7.2 host, downgrading to python-requests-1.1.0-8.el7 resolves the issue.

$ rpm -q python-requests python-urllib3
python-requests-2.6.0-4.el7.noarch
python-urllib3-1.10.2-1.el7.noarch

$ python -c 'import requests'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 60, in <module>
    from .api import request, get, head, post, patch, put, delete, options
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 14, in <module>
    from . import sessions
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 27, in <module>
    from .adapters import HTTPAdapter
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 29, in <module>
    from .packages.urllib3.exceptions import ResponseError
ImportError: cannot import name ResponseError

$ rpm -q python-requests python-urllib3                         
python-requests-1.1.0-8.el7.noarch
python-urllib3-1.10.2-1.el7.noarch
$ python -c 'import requests'
$

Comment 7 Keith Robertson 2015-07-06 17:24:02 UTC
(In reply to Scott Dodson from comment #6)
> This breaks my RHEL 7.2 host, downgrading to python-requests-1.1.0-8.el7
> resolves the issue.
> 
> $ rpm -q python-requests python-urllib3
> python-requests-2.6.0-4.el7.noarch
> python-urllib3-1.10.2-1.el7.noarch
> 
> $ python -c 'import requests'
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 60, in
> <module>
>     from .api import request, get, head, post, patch, put, delete, options
>   File "/usr/lib/python2.7/site-packages/requests/api.py", line 14, in
> <module>
>     from . import sessions
>   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 27, in
> <module>
>     from .adapters import HTTPAdapter
>   File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 29, in
> <module>
>     from .packages.urllib3.exceptions import ResponseError
> ImportError: cannot import name ResponseError
> 
> $ rpm -q python-requests python-urllib3                         
> python-requests-1.1.0-8.el7.noarch
> python-urllib3-1.10.2-1.el7.noarch
> $ python -c 'import requests'
> $


Are the RPMs identified in these 3 errata installed on the box?
python-chardet - https://errata.devel.redhat.com/advisory/20881
python-urllib3 - https://errata.devel.redhat.com/advisory/20876
python-requests - https://errata.devel.redhat.com/advisory/20447

Comment 8 Matej Stuchlik 2015-07-07 13:13:52 UTC
I wager a guess you have an old version of urllib3 somewhere, somehow. Could you please run these commands and let me know what the output is?

% ls /usr/lib/python2.7/site-packages/requests/packages/
% grep __version__ /usr/lib/python2.7/site-packages/urllib3/__init__.py

Comment 9 Scott Dodson 2015-07-08 00:29:01 UTC
$ ls /usr/lib/python2.7/site-packages/requests/packages/
chardet  __init__.py  __init__.pyc  __init__.pyo  urllib3
$ grep __version__ /usr/lib/python2.7/site-packages/urllib3/__init__.py
__version__ = '1.10.2'

$ rpm -q python-urllib3 python-requests python-chardet
python-urllib3-1.10.2-1.el7_1.noarch
python-requests-2.6.0-4.el7.noarch
python-chardet-2.2.1-1.el7_1.noarch

$ rpm -Va python-urllib3 python-requests python-chardet

$ pip freeze | grep -e urllib -e requests -e chardet
chardet==2.2.1
requests==2.6.0
urllib2-kerberos==0.1.6
urllib3==1.10.2

Anything else I can check? If this works on a clean install of 7.2 I'm fine with assuming it's something messed up with my system but all of the packages verify and they're fully up to date with 7.2 nightlies.

Comment 10 Matej Stuchlik 2015-07-09 08:01:11 UTC
(In reply to Scott Dodson from comment #9)
> $ ls /usr/lib/python2.7/site-packages/requests/packages/
> chardet  __init__.py  __init__.pyc  __init__.pyo  urllib3

This right here is likely the culprit. The directory shouldn't contain 'chardet' and, more importantly, 'urllib3' as I do the following in the python-requests .spec file:

# Unbundle chardet and urllib3.
rm -rf build/lib/requests/packages/chardet
rm -rf build/lib/requests/packages/chardet

What you have there is likely an older version of urllib3 that does not contain ResponseError. The way requests are made, they look for urllib3 first in the packages directory and only then do they look for the system module.

Obviously this shouldn't happen, unless you've done something non-standard. I'll investigate.

Comment 11 Matej Stuchlik 2015-07-09 08:13:07 UTC
Scott, do you happen to remember what version of requests you've had installed, and from what product, before updating to 2.6.0? I've tried going from 1.1.0-8_el7 to 2.6.0-4_el7 and everything seems to be working fine.

I'm gonna guess whatever version it was, it did not unbundle those modules.

Comment 12 Scott Dodson 2015-07-09 21:39:41 UTC
(In reply to Matej Stuchlik from comment #11)
> Scott, do you happen to remember what version of requests you've had
> installed, and from what product, before updating to 2.6.0? I've tried going
> from 1.1.0-8_el7 to 2.6.0-4_el7 and everything seems to be working fine.
> 
> I'm gonna guess whatever version it was, it did not unbundle those modules.

Matej, The only RPM version I've had previously was python-requests-1.1.0-8.el7.noarch, at least as far back as yum history reports. I've had to install nova client using pip so it's potentially a side effect of that.

Cleaning out the packages resolved the issue. Sorry for the disruption.

Comment 15 daryl herzmann 2016-01-14 23:06:28 UTC
Hello,  I am curious about the status of this bugzilla.  The fix version notes: python-requests-2.6.0-4.el7

My RHEL7.2 workstation box has: 

Source RPM  : python-requests-2.6.0-1.el7_1.src.rpm
Build Date  : Wed 24 Jun 2015 06:45:25 AM CDT
Build Host  : ppc-020.build.eng.bos.redhat.com
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.