launchpadlib scripts break when run under python 2.6

Bug #358004 reported by Graham Binns
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tarmac
Invalid
Undecided
Unassigned
launchpadlib
Triaged
Undecided
Unassigned
python-launchpadlib (Ubuntu)
Invalid
High
Unassigned

Bug Description

Trying to run either of Tarmac (http://launchpad.net/tarmac) or the upstream-packagebugs script (http://launchpad.net/lp-upstream-tools) under Python 2.6 on Jaunty produces a traceback (Tarmac version attached). Running either of the above under python 2.5 makes the problem go away.

Revision history for this message
Graham Binns (gmb) wrote :
Revision history for this message
James Westby (james-w) wrote :

  File "/usr/lib/python2.6/httplib.py", line 699, in send
    self.connect()
  File "build/bdist.linux-i686/egg/httplib2/__init__.py", line 736, in connect

  File "<string>", line 1, in settimeout
TypeError: a float is required

I don't see this issue, and the appearance of an egg there is a difference
that is immediately apparent. Do you know where this is getting
picked up from, and does avoiding it make the problem go away?

Thanks,

James

Changed in python-launchpadlib (Ubuntu):
importance: Undecided → High
Revision history for this message
James Westby (james-w) wrote :

I just remembered bug 336067, could you check if the egg is too old
to contain that fix?

Thanks,

James

Changed in launchpadlib:
status: New → Incomplete
Revision history for this message
Paul Hummer (rockstar) wrote :

This bug does not affect the python-launchpadlib in Ubuntu, but in the Launchpad specific PPA that provides legacy support for python 2.4. I reverted back to the official python-launchpadlib and everything works.

Changed in tarmac:
status: New → Invalid
Changed in python-launchpadlib (Ubuntu):
status: New → Invalid
Revision history for this message
Björn Tillenius (bjornt) wrote :

I'm confirming this bug, since launchpadlib isn't working under python 2.6 when installing using 'python2.6 setup.py install'.

Changed in launchpadlib:
status: Incomplete → Triaged
Revision history for this message
James Westby (james-w) wrote :

Hi,

Could you include the output of

  apt-cache policy python-httplib2

and

  python -c 'import httplib2; print httplib2.__path__'

please.

Thanks,

James

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 358004] Re: launchpadlib scripts break when run under python 2.6

On Fri, Apr 24, 2009 at 11:25:50AM -0000, James Westby wrote:
> Hi,
>
> Could you include the output of
>
> apt-cache policy python-httplib2

ixia:~> apt-cache policy python-httplib2
python-httplib2:
  Installed: 0.4.0-0ubuntu2
  Candidate: 0.4.0-0ubuntu2
  Version table:
 *** 0.4.0-0ubuntu2 0
        500 http://lt.archive.ubuntu.com jaunty/universe Packages
        100 /var/lib/dpkg/status

> python -c 'import httplib2; print httplib2.__path__'

ixia:~> python -c 'import httplib2; print httplib2.__path__'
/usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2/__init__.py:29: DeprecationWarning: the md5 module is deprecated; use hashlib instead
/usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2/__init__.py:44: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
['/usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2']

Revision history for this message
Leonard Richardson (leonardr) wrote :

I haven't been able to test this, but a possible workaround is to pass in timeout=20.0 when creating the Launchpad object. Try this and see if it works.

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 358004] Re: launchpadlib scripts break when run under python 2.6

On Fri, 2009-04-24 at 12:16 +0000, Björn Tillenius wrote:
> > python -c 'import httplib2; print httplib2.__path__'
>
> ixia:~> python -c 'import httplib2; print httplib2.__path__'
> /usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2/__init__.py:29: DeprecationWarning: the md5 module is deprecated; use hashlib instead
> /usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2/__init__.py:44: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
> ['/usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2']

That's odd.

Was this installed by setuptools at some point?

It seems that a new release of httplib2 has not been made with
the python2.6 fix, so any setup.py install will lead to this
error.

If you remove the egg and use the packaged version then you
won't have this issue.

Thanks,

James

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 358004] Re: launchpadlib scripts break when run under python 2.6

On Fri, Apr 24, 2009 at 12:19:20PM -0000, Leonard Richardson wrote:
> I haven't been able to test this, but a possible workaround is to pass
> in timeout=20.0 when creating the Launchpad object. Try this and see if
> it works.

No, that workaround doesn't seem to work.

Revision history for this message
Björn Tillenius (bjornt) wrote :

On Fri, Apr 24, 2009 at 12:49:07PM -0000, James Westby wrote:
> On Fri, 2009-04-24 at 12:16 +0000, Björn Tillenius wrote:
> > > python -c 'import httplib2; print httplib2.__path__'
> >
> > ixia:~> python -c 'import httplib2; print httplib2.__path__'
> > /usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2/__init__.py:29: DeprecationWarning: the md5 module is deprecated; use hashlib instead
> > /usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2/__init__.py:44: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
> > ['/usr/local/lib/python2.6/dist-packages/httplib2-0.4.0-py2.6.egg/httplib2']
>
> That's odd.
>
> Was this installed by setuptools at some point?

Yes, it was.

> If you remove the egg and use the packaged version then you
> won't have this issue.

Right. It's still an issue that installing via setuptools doesn't work.
The reason I installed via setuptools was that the latest launchpadlib
bzr revision wasn't available as a package.

Revision history for this message
Paul Hummer (rockstar) wrote :

I don't think the real issue is in launchpadlib, but in the upstream httplib2. What I did to fix the bug is to install the packaged version of httplib2, and that's it. It worked fine after that, and I'm running Tarmac on Jaunty now.

Revision history for this message
Björn Tillenius (bjornt) wrote :

On Fri, Apr 24, 2009 at 02:37:44PM -0000, Paul Hummer wrote:
> I don't think the real issue is in launchpadlib, but in the upstream
> httplib2. What I did to fix the bug is to install the packaged version
> of httplib2, and that's it. It worked fine after that, and I'm running
> Tarmac on Jaunty now.

I'd say it is an issue with launchpadlib, since it installs the broken
version of httplib2.

Revision history for this message
Leonard Richardson (leonardr) wrote :

I was really confused by this issue so I asked Gary to do some research and he came up with the following.

1. The problem is a real problem in stock httplib2 0.4.0.
2. The httplib2 that comes with Jaunty is patched to avoid or fix the bug.
3. The Launchpad PPA includes an httplib2 that has the bug.

So if you use Jaunty as a normal user, you shouldn't have a problem. If you use Jaunty and you're also a Launchpad developer, you'll have the problem (because the PPA version has the bug). If you check out the source from Launchpad, you'll have the problem (because the PyPi version has the bug).

Revision history for this message
Gary Poster (gary) wrote :
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.