traceback if python has no ssl support: httplib module has no HTTPSConnection

Bug #411296 reported by Gary Chou
44
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Vincent Ladeuil

Bug Description

root@ubuntu:/source/bzr-1.17# bzr --no-plugins cat http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/utilities/rocketfuel-setup > rocketfuel-setup
bzr: ERROR: exceptions.AttributeError: 'module' object has no attribute 'HTTPSConnection'

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/commands.py", line 1045, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/builtins.py", line 2771, in run
    bzrdir.BzrDir.open_containing_tree_or_branch(filename)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 964, in open_containing_tree_or_branch
    bzrdir, relpath = klass.open_containing(location)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 890, in open_containing
    transport = get_transport(url, possible_transports)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/lazy_import.py", line 125, in __call__
    return obj(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/transport/__init__.py", line 1587, in get_transport
    transport, last_err = _try_transport_factories(base, factory_list)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/transport/__init__.py", line 1610, in _try_transport_factories
    return factory.get_obj()(base), None
  File "/usr/local/lib/python2.6/site-packages/bzrlib/registry.py", line 61, in get_obj
    self._do_import()
  File "/usr/local/lib/python2.6/site-packages/bzrlib/registry.py", line 70, in _do_import
    obj = __import__(self._module_name, globals(), locals(), names)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/transport/http/_urllib.py", line 29, in <module>
    from bzrlib.transport.http._urllib2_wrappers import (
  File "/usr/local/lib/python2.6/site-packages/bzrlib/transport/http/_urllib2_wrappers.py", line 296, in <module>
    class HTTPSConnection(AbstractHTTPConnection, httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'

bzr 1.17 on python 2.6.2 (linux2)
arguments: ['/usr/local/bin/bzr', '--no-plugins', 'cat', 'http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/utilities/rocketfuel-setup']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 411296] [NEW] plugins: *** Bazaar has encountered an internal error.

Do you think this bug is related to a plugin?

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Martin Pool (mbp) wrote : Re: httplib module has no HTTPSConnection

This looks like something is missing from your Python installation. What OS are you using?

summary: - plugins: *** Bazaar has encountered an internal error.
+ httplib module has no HTTPSConnection
Changed in bzr:
status: New → Confirmed
status: Confirmed → Incomplete
importance: Undecided → Medium
Revision history for this message
Martin Pool (mbp) wrote :

This works for me on Jaunty:

python -c "import httplib;print httplib.HTTPSConnection"

I guess it fails for you?

You're probably missing the python SSL package. On Ubuntu this is part of python2.6 so we don't give a specific message for it, but it's probably possible to build Python without it.

We should probably detect the absence of this and give a clearer error. httplib swallows the ImportError so we'd have to detect HTTPSConnection is missing.

summary: - httplib module has no HTTPSConnection
+ traceback if python has no ssl support: httplib module has no
+ HTTPSConnection
Changed in bzr:
status: Incomplete → Confirmed
importance: Medium → Low
Revision history for this message
Vincent Ladeuil (vila) wrote :

In my experience this is due to an incomplete python (i.e. missing the _ssl module).
It's weird that you seem to experience that with an Ubuntu distro where py26 comes with the _ssl module.

Anyway, there is a genuine bug here as bzr shouldn't backtrace but just not try to support https if the required python module is not present.

Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
importance: Low → Medium
status: Confirmed → Incomplete
Revision history for this message
Martin Pool (mbp) wrote :

His machine seems to be called Ubuntu but that's not quite a guarantee :)

Vincent Ladeuil (vila)
Changed in bzr:
status: Incomplete → Confirmed
Revision history for this message
Gary Chou (gary-chou) wrote : Re: [Bug 411296] Re: httplib module has no HTTPSConnection
Download full text (3.7 KiB)

I am running Ubuntu 9.04.

 Best Regards,

Gary Chou

________________________________
From: Martin Pool <email address hidden>
To: <email address hidden>
Sent: Monday, August 10, 2009 4:50:07 PM
Subject: [Bug 411296] Re: httplib module has no HTTPSConnection

This looks like something is missing from your Python installation.
What OS are you using?

** Summary changed:

- plugins: *** Bazaar has encountered an internal error.
+ httplib module has no HTTPSConnection

** Changed in: bzr
       Status: New => Confirmed

** Changed in: bzr
       Status: Confirmed => Incomplete

** Changed in: bzr
   Importance: Undecided => Medium

--
httplib module has no HTTPSConnection
https://bugs.launchpad.net/bugs/411296
You received this bug notification because you are a direct subscriber
of the bug.

Status in Bazaar Version Control System: Incomplete

Bug description:
root@ubuntu:/source/bzr-1.17# bzr --no-plugins cat http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/utilities/rocketfuel-setup > rocketfuel-setup
bzr: ERROR: exceptions.AttributeError: 'module' object has no attribute 'HTTPSConnection'

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/commands.py", line 1045, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/builtins.py", line 2771, in run
    bzrdir.BzrDir.open_containing_tree_or_branch(filename)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 964, in open_containing_tree_or_branch
    bzrdir, relpath = klass.open_containing(location)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 890, in open_containing
    transport = get_transport(url, possible_transports)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/lazy_import.py", line 125, in __call__
    return obj(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/transport/__init__.py", line 1587, in get_transport
    transport, last_err = _try_transport_factories(base, factory_list)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/transport/__init__.py", line 1610, in _try_transport_factories
    return factory.get_obj()(base), None
  File "/usr/local/lib/python2.6/site-packages/bzrlib/registry.py", line 61, in get_obj
    self._do_import()
  File "/usr/local/lib/python2.6/site-packages/bzrlib/registry.py", line 70, in _do_import
    obj = __import__(self._module_name, globals(), locals(), names)
  File "/usr/local/lib/python2.6/site-packages/bzrlib/transport/http/_urllib.py", line 29, in <module>
    from bzrlib.transport.http._urllib2_wrappers import (
  File "/usr/local/lib/python2.6/site-packages/bzrlib/transport/http/_urllib2_wrappers.py", line 296, in <module>
    class HTTPSConnection(AbstractHTTPConnection, httpli...

Read more...

Jelmer Vernooij (jelmer)
tags: added: https
Revision history for this message
Martin Pool (mbp) wrote :

@bialix, done, except that unfortunately your comment has propagated the link :)

Revision history for this message
Alexander Belchenko (bialix) wrote :

I'm very sorry.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 411296] Re: traceback if python has no ssl support: httplib module has no HTTPSConnection

It's not a problem, I asked for yours to be removed or edited too.

Martin Pool (mbp)
tags: added: error-reporting traceback
Jelmer Vernooij (jelmer)
tags: added: pypy
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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