[python3-setuptools] AttributeError: 'HTTPMessage' object has no attribute 'getheaders'

Bug #910965 reported by Dmitry Tantsur
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
distribute (Ubuntu)
Fix Released
Undecided
Unassigned
Oneiric
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
installing python3 modules that need downloading does not work due to use of a function not available in python3

[Development Fix]
upstream now uses a method available in all python versions, that fix applies to oneiric. (https://bitbucket.org/tarek/distribute/issue/206)
Note the fix does not reintroduce issue 196 as the method only returns one entry of the header even if there are multiple.
(https://bitbucket.org/tarek/distribute/issue/196/)

[Stable Fix]
See comment #2
https://bugs.launchpad.net/ubuntu/+source/distribute/+bug/910965/+attachment/2654584/+files/getheaderpatch.patch

[Testcase]
sudo apt-get install python3-setuptools
mkdir -p /tmp/inst//lib/python3.2/site-packages
PYTHONPATH=/tmp/inst//lib/python3.2/site-packages easy_install3 --prefix /tmp/inst/ pyzmq
#or any other packages that is not installed

expected result: successful installation in the prefix
real result: traceback see original report

[Regression Potential]
<fill me in with a discussion of likelihood and potential severity of regressions and how users could get inadvertently affected. >

original report:
$ sudo easy_install3 pyzmq
Searching for pyzmq
Reading http://pypi.python.org/simple/pyzmq/
Reading http://github.com/zeromq/pyzmq
Reading http://github.com/zeromq/pyzmq/downloads
Best match: pyzmq 2.1.11
Downloading https://github.com/downloads/zeromq/pyzmq/pyzmq-2.1.11.zip
Traceback (most recent call last):
  File "/usr/bin/easy_install3", line 9, in <module>
    load_entry_point('distribute==0.6.16dev-r0', 'console_scripts', 'easy_install')()
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1912, in main
    with_ei_usage(lambda:
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1893, in with_ei_usage
    return f()
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1916, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 364, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 591, in easy_install
    self.local_index
  File "/usr/lib/python3/dist-packages/setuptools/package_index.py", line 492, in fetch_distribution
    dist = find(requirement)
  File "/usr/lib/python3/dist-packages/setuptools/package_index.py", line 475, in find
    location=self.download(dist.location, tmpdir)
  File "/usr/lib/python3/dist-packages/setuptools/package_index.py", line 414, in download
    found = self._download_url(scheme.group(1), spec, tmpdir)
  File "/usr/lib/python3/dist-packages/setuptools/package_index.py", line 663, in _download_url
    return self._attempt_download(url, filename)
  File "/usr/lib/python3/dist-packages/setuptools/package_index.py", line 672, in _attempt_download
    headers = self._download_to(url, filename)
  File "/usr/lib/python3/dist-packages/setuptools/package_index.py", line 583, in _download_to
    content_length = headers.getheaders("Content-Length")[0]
AttributeError: 'HTTPMessage' object has no attribute 'getheaders'

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: python3-setuptools 0.6.16-1
ProcVersionSignature: Ubuntu 3.0.0-14.23-generic 3.0.9
Uname: Linux 3.0.0-14-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Tue Jan 3 00:33:54 2012
InstallationMedia: Xubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101008.1)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=ru_RU.UTF-8
 SHELL=/bin/bash
SourcePackage: distribute
UpgradeStatus: Upgraded to oneiric on 2011-08-10 (145 days ago)

Related branches

Revision history for this message
Dmitry Tantsur (divius) wrote :
Revision history for this message
Julian Taylor (jtaylor) wrote :

thanks for the report.
this issue was fixed in distribute 6.19 released in the current development release precise:
 http://pypi.python.org/pypi/distribute#id6

attached patch for the oneiric package should fix it.

Changed in distribute (Ubuntu):
status: New → Fix Released
Julian Taylor (jtaylor)
description: updated
Bryce Harrington (bryce)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in distribute (Ubuntu Oneiric):
status: New → Confirmed
Revision history for this message
Evan Broder (broder) wrote :

Julian - Thanks for looking into this. I've uploaded the change to oneiric-proposed; someone from the SRU team should accept it and begin the verification process shortly.

(They'd probably prefer if you could finish filling out the SRU report in the bug description by then)

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Dmitry, or anyone else affected,

Accepted distribute into oneiric-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in distribute (Ubuntu Oneiric):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Dmitry Tantsur (divius) wrote :

Works with package from proposed

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package distribute - 0.6.16-1ubuntu0.1

---------------
distribute (0.6.16-1ubuntu0.1) oneiric-proposed; urgency=low

  * setuptools/package_index.py:
    - add easy_install HTTPMessage fix from 0.6.19 (LP: #910965)
 -- Julian Taylor <email address hidden> Tue, 14 Feb 2012 23:28:12 -0800

Changed in distribute (Ubuntu Oneiric):
status: Fix Committed → Fix Released
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.