The traceback below is for reference:
Since the traceback points to "socket.py" doing a "from _ssl import SSLError as
sslerror" at around line 106 which was sandwitched in the try:.. else:.. block I was
confused as to how that else block got executed at all as _ssl is not available.
try:
import _ssl
except ImportError:
# no SSL support
pass
else:
[...]
from _ssl import SSLError as sslerror
from _ssl import \
It seems mercurial is doing some magic with the imports. Ideally it should not be
executing the (conditional) imports in the `else` block.
Further investigation shows that "import _ssl" succeeded (!) even though it normally
wouldn't .. and _ssl is now an instance of mercurial.demandimport._demandmod!
Original traceback:
File "/home/apy/ActivePython-2.6/lib/python2.6/site-
packages/mercurial/demandimport.py", line 47, in _load
mod = _origimport(head, globals, locals)
File "/home/apy/ActivePython-2.6/lib/python2.6/site-packages/mercurial/url.py", line
98, in <module>
class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm):
File "/home/apy/ActivePython-2.6/lib/python2.6/site-
packages/mercurial/demandimport.py", line 75, in __getattribute__
self._load()
File "/home/apy/ActivePython-2.6/lib/python2.6/site-
packages/mercurial/demandimport.py", line 47, in _load
mod = _origimport(head, globals, locals)
File "/home/apy/ActivePython-2.6/lib/python2.6/urllib2.py", line 109, in <module>
from urllib import (unwrap, unquote, splittype, splithost, quote,
File "/home/apy/ActivePython-2.6/lib/python2.6/site-
packages/mercurial/demandimport.py", line 106, in _demandimport
mod = _origimport(name, globals, locals)
File "/home/apy/ActivePython-2.6/lib/python2.6/urllib.py", line 837, in <module>
class ftpwrapper:
File "/home/apy/ActivePython-2.6/lib/python2.6/urllib.py", line 841, in ftpwrapper
timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
File "/home/apy/ActivePython-2.6/lib/python2.6/site-
packages/mercurial/demandimport.py", line 75, in __getattribute__
self._load()
File "/home/apy/ActivePython-2.6/lib/python2.6/site-
packages/mercurial/demandimport.py", line 47, in _load
mod = _origimport(head, globals, locals)
File "/home/apy/ActivePython-2.6/lib/python2.6/socket.py", line 64, in <module>
from _ssl import SSLError as sslerror
File "/home/apy/ActivePython-2.6/lib/python2.6/site-
packages/mercurial/demandimport.py", line 106, in _demandimport
mod = _origimport(name, globals, locals)
ImportError: No module named _ssl
abort: could not import module _ssl!
Exception AttributeError: "'httprepository' object has no attribute 'urlopener'" in
<bound method httprepository.__del__ of <mercurial.httprepo.httprepository object at
0x204bbe90>> ignored
bash-2.04$
|