AttributeError: 'module' object has no attribute 'HTTPSConnection'

Bug #663706 reported by Ronen Moldovan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

After failing to raise explorer on Python 2.4, I've installed Python 2.7 with the latest Qt, PyQt and bazaar versions (on CentOS).

Now I'm getting the following exception:

bzr: ERROR: exceptions.AttributeError: 'module' object has no attribute 'HTTPSConnection'

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/lib/python2.7/site-packages/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/local/lib/python2.7/site-packages/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/ronenm/.bazaar/plugins/explorer/lib/commands.py", line 161, in run
    window = explorer.QExplorerMainWindow(location_list=location_list,
  File "/usr/local/lib/python2.7/site-packages/bzrlib/lazy_import.py", line 106, in __getattribute__
    obj = _replace()
  File "/usr/local/lib/python2.7/site-packages/bzrlib/lazy_import.py", line 89, in _replace
    obj = factory(self, scope, name)
  File "/usr/local/lib/python2.7/site-packages/bzrlib/lazy_import.py", line 192, in _import
    module = __import__(module_python_path, scope, scope, [member])
  File "/home/ronenm/.bazaar/plugins/explorer/lib/explorer.py", line 31, in <module>
    from bzrlib.plugins.explorer.lib import (
  File "/home/ronenm/.bazaar/plugins/explorer/lib/hosted_url_resolver.py", line 21, in <module>
    from bzrlib.plugins.launchpad.lp_registration import (
  File "/usr/local/lib/python2.7/site-packages/bzrlib/plugins/launchpad/lp_registration.py", line 30, in <module>
    from bzrlib.transport.http import _urllib2_wrappers
  File "/usr/local/lib/python2.7/site-packages/bzrlib/transport/http/_urllib2_wrappers.py", line 304, in <module>
    class HTTPSConnection(AbstractHTTPConnection, httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'

bzr 2.2.1 on python 2.7.0 (Linux-2.6.18-164.el5PAE-i686-with-redhat-5.4-Final)
arguments: ['/usr/local/bin/bzr', 'explorer']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bash_completion /usr/local/lib/python2.7/site-packages/bzrlib/plugins/bash_completion [2.2.1]
  explorer /home/ronenm/.bazaar/plugins/explorer [1.1.1]
  launchpad /usr/local/lib/python2.7/site-packages/bzrlib/plugins/launchpad [2.2.1]
  netrc_credential_store /usr/local/lib/python2.7/site-packages/bzrlib/plugins/netrc_credential_store [2.2.1]
  news_merge /usr/local/lib/python2.7/site-packages/bzrlib/plugins/news_merge [2.2.1]
  qbzr /usr/local/lib/python2.7/site-packages/bzrlib/plugins/qbzr [0.19.2]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.
Exit 4

summary: - exception when trying to use Bazaar Explorer
+ AttributeError: 'module' object has no attribute 'HTTPSConnection'
affects: bzr-explorer → bzr
Revision history for this message
Vincent Ladeuil (vila) wrote :

Right, this should be fixed in bzr, but I note that's it's a dupe and the root cause is, AFAIK, a custom python which doesn't include the ssl module (standard for python >= 2.6) which is a *bad* thing.

Changed in bzr:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Ronen Moldovan (ronen-moldovan) wrote :

Please note that I downloaded official Python 2.7 release and compiled it with all default settings.

Is it possible that 2.7 does not include the ssl module? I'll try to download it seperately.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Ouch. This is worth investigating then, but it would be really surprising that ssl is not included in python2.7... I strongly recommend double-checking the configure/compilation process. I seem to remember that some modules need to be nudged a bit... including the ssl one (sorry for being so vague, my last experiment was in the 2.6beta era).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.