building of python C extensions with setuptools is broken

Bug #428004 reported by Elliot Murphy
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu One Servers
Fix Released
Elliot Murphy
python-setuptools (Ubuntu)
Fix Released
Matthias Klose
Fix Released
Matthias Klose

Bug Description

Binary package hint: python2.6

This problem is new since python2.6 2.6.2-0ubuntu2 was uploaded to Karmic.
As part of my project, we regularly run python build for a few zope modules, including some such as zope.proxy that include C extensions. very recently, this started failing under python 2.6. It still works fine under python2.5. I believe this is a regression that was introduced when the new version of python2.6 was uploaded in order to fix

I don't know enough about setuptools internals (yet) to submit a patch, but I can point to exactly what is going wrong:

Here is a terminal session that shows me grabbing the source for zope.proxy, running build, and printing some variables from the python debugger to explain the traceback that happens:

emurphy@detox:~$ bzr get lp:zope.proxy
Branched 28 revision(s).
emurphy@detox:~$ cd zope.proxy/
emurphy@detox:~/zope.proxy$ python build
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/zope
copying src/zope/ -> build/lib.linux-i686-2.6/zope
creating build/lib.linux-i686-2.6/zope/proxy
copying src/zope/proxy/ -> build/lib.linux-i686-2.6/zope/proxy
copying src/zope/proxy/ -> build/lib.linux-i686-2.6/zope/proxy
copying src/zope/proxy/ -> build/lib.linux-i686-2.6/zope/proxy
running egg_info
creating src/zope.proxy.egg-info
writing requirements to src/zope.proxy.egg-info/requires.txt
writing src/zope.proxy.egg-info/PKG-INFO
writing namespace_packages to src/zope.proxy.egg-info/namespace_packages.txt
writing top-level names to src/zope.proxy.egg-info/top_level.txt
writing dependency_links to src/zope.proxy.egg-info/dependency_links.txt
writing manifest file 'src/zope.proxy.egg-info/SOURCES.txt'
> /usr/lib/python2.6/dist-packages/setuptools/command/
-> filename = _build_ext.get_ext_filename(self,fullname)
(Pdb) c
reading manifest file 'src/zope.proxy.egg-info/SOURCES.txt'
writing manifest file 'src/zope.proxy.egg-info/SOURCES.txt'
copying src/zope/proxy/_zope_proxy_proxy.c -> build/lib.linux-i686-2.6/zope/proxy
running build_ext
> /usr/lib/python2.6/dist-packages/setuptools/command/
-> filename = _build_ext.get_ext_filename(self,fullname)
(Pdb) n
> /usr/lib/python2.6/dist-packages/setuptools/command/
-> ext = self.ext_map[fullname]
(Pdb) p filename
(Pdb) pp self.ext_map
{'zope.proxy._zope_proxy_proxy': <setuptools.extension.Extension instance at 0xa038aec>}
(Pdb) p fullname
(Pdb) c
Traceback (most recent call last):
  File "", line 72, in <module>
    zip_safe = False,
  File "/usr/lib/python2.6/distutils/", line 152, in setup
  File "/usr/lib/python2.6/distutils/", line 975, in run_commands
  File "/usr/lib/python2.6/distutils/", line 995, in run_command
  File "/usr/lib/python2.6/distutils/command/", line 135, in run
  File "/usr/lib/python2.6/distutils/", line 333, in run_command
  File "/usr/lib/python2.6/distutils/", line 995, in run_command
  File "/usr/lib/python2.6/dist-packages/setuptools/command/", line 46, in run
  File "/usr/lib/python2.6/distutils/command/", line 340, in run
  File "/usr/lib/python2.6/dist-packages/Pyrex/Distutils/", line 82, in build_extensions
  File "/usr/lib/python2.6/dist-packages/setuptools/command/", line 176, in build_extension
  File "/usr/lib/python2.6/distutils/command/", line 460, in build_extension
    ext_path = self.get_ext_fullpath(
  File "/usr/lib/python2.6/distutils/command/", line 633, in get_ext_fullpath
    filename = self.get_ext_filename(modpath[-1])
  File "/usr/lib/python2.6/dist-packages/setuptools/command/", line 86, in get_ext_filename
    ext = self.ext_map[fullname]
KeyError: '_zope_proxy_proxy'

ProblemType: Bug
Architecture: i386
Date: Fri Sep 11 13:03:47 2009
DistroRelease: Ubuntu 9.10
Package: python2.6 2.6.2-0ubuntu5
 PATH=(custom, user)
ProcVersionSignature: Ubuntu 2.6.31-10.30-generic-pae
SourcePackage: python2.6
Uname: Linux 2.6.31-10-generic-pae i686

Revision history for this message
Elliot Murphy (statik) wrote :
Changed in ubuntuone-servers:
assignee: nobody → Elliot Murphy (statik)
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Elliot Murphy (statik) wrote :

ScottK pointed out that building C extensions that don't use setuptools seems to be working fine.

summary: - building of python C extensions is broken
+ building of python C extensions with setuptools is broken
Revision history for this message
Ilya Barygin (randomaction) wrote :

Looks similar to bug 427496.

tags: added: regression-potential
Changed in python2.6 (Ubuntu Karmic):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Robbie Williamson (robbiew) wrote :

Is this related to bug 392355 ?

Changed in python2.6 (Ubuntu Karmic):
assignee: nobody → Matthias Klose (doko)
Revision history for this message
Tarek Ziadé (tziade) wrote :

Here's a detailed explanation of the problem:

I doubt setuptools will be fixed and released any soon for that. The project didn't see any commit from his maintainer since a year, and
he doesn't want anyone else that wish to help to take over to do so.

That's why we created a fork called Distribute that tries to fix the bugs founded in this project.

So there are two options for projects that build extensions:

- use plain distutils
- switch to Distribute 0.6.x.

Matthias Klose (doko)
affects: python2.6 (Ubuntu Karmic) → python-setuptools (Ubuntu Karmic)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-setuptools - 0.6c9-0ubuntu5

python-setuptools (0.6c9-0ubuntu5) karmic; urgency=low

  * Fix building extensions with recent python 2.6.2+. Patch taken from LP: #428004.

 -- Matthias Klose <email address hidden> Sun, 13 Sep 2009 12:11:58 +0200

Changed in python-setuptools (Ubuntu Karmic):
status: Triaged → Fix Released
Elliot Murphy (statik)
Changed in ubuntuone-servers:
status: Confirmed → Fix Released
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.