"NameError: global name 're' is not defined" in ssl module
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python2.7 (Ubuntu) |
Confirmed
|
High
|
Unassigned |
Bug Description
After the upgrade from python2.7 2.7.4~rc1-4ubuntu1 to 2.7.4-1ubuntu2 today, pip (latest release, 1.3.1, installed from PyPI) stopped working due to a "re" import missing in the "ssl" module in Python's standard library.
A small example to reproduce the crash:
$ python
Python 2.7.4 (default, Apr 8 2013, 21:29:38)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.__file__
'/usr/lib/
>>> ssl._dnsname_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
frag = re.escape(frag)
NameError: global name 're' is not defined
>>>
Full output from pip:
$ pip --version
pip 1.3.1 from /usr/local/
$ sudo pip install -U pip
Exception:
Traceback (most recent call last):
File "/usr/local/
status = self.run(options, args)
File "/usr/local/
un
requirement
File "/usr/local/
req_to_install, self.upgrade)
File "/usr/local/
ment
page = self._get_
File "/usr/local/
return HTMLPage.
File "/usr/local/
resp = urlopen(url)
File "/usr/local/
response = self.get_
File "/usr/lib/
response = self._open(req, data)
File "/usr/lib/
'_open', req)
File "/usr/lib/
result = func(*args)
File "/usr/local/
n
return self.do_
File "/usr/lib/
h.request(
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.send(msg)
File "/usr/lib/
self.connect()
File "/usr/local/
match_
File "/usr/lib/
if _dnsname_
File "/usr/lib/
frag = re.escape(frag)
NameError: global name 're' is not defined
Storing complete log in /home/jodal/
Changed in python2.7 (Ubuntu): | |
importance: | Undecided → High |
status: | New → Confirmed |
The bug is in the ssl.match_ hostname. diff patch applied by Ubuntu: http:// bazaar. launchpad. net/~ubuntu- branches/ ubuntu/ raring/ python2. 7/raring/ view/head: /debian/ patches/ ssl.match_ hostname. diff