1. Ned Batchelder
  2. coverage.py
  3. Issues
Issue #27 resolved

KeyError exception during install

Anonymous created an issue

I am attempting to install coverage version 3.1 under Python 2.6.3 on a RHEL 5.3 machine. Setuptools version 0.6c9 is installed as well. No matter which way I try, easy_install or the conventional Python module install, I get the following output.

{{{ -bash-3.2$ python setup.py install running install running bdist_egg running egg_info writing coverage.egg-info/PKG-INFO writing top-level names to coverage.egg-info/top_level.txt writing dependency_links to coverage.egg-info/dependency_links.txt writing entry points to coverage.egg-info/entry_points.txt reading manifest file 'coverage.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'test' writing manifest file 'coverage.egg-info/SOURCES.txt' installing library code to build/bdist.linux-i686/egg running install_lib running build_py running build_ext Traceback (most recent call last): File "setup.py", line 105, in <module> **more_setup_args File "/home/agrimstr/ACSPython/lib/python2.6/distutils/core.py", line 152, in setup dist.run_commands() File "/home/agrimstr/ACSPython/lib/python2.6/distutils/dist.py", line 975, in run_commands self.run_command(cmd) File "/home/agrimstr/ACSPython/lib/python2.6/distutils/dist.py", line 995, in run_command cmd_obj.run() File "build/bdist.linux-i686/egg/setuptools/command/install.py", line 76, in run File "build/bdist.linux-i686/egg/setuptools/command/install.py", line 96, in do_egg_install File "/home/agrimstr/ACSPython/lib/python2.6/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/home/agrimstr/ACSPython/lib/python2.6/distutils/dist.py", line 995, in run_command cmd_obj.run() File "build/bdist.linux-i686/egg/setuptools/command/bdist_egg.py", line 174, in run File "build/bdist.linux-i686/egg/setuptools/command/bdist_egg.py", line 161, in call_command File "/home/agrimstr/ACSPython/lib/python2.6/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/home/agrimstr/ACSPython/lib/python2.6/distutils/dist.py", line 995, in run_command cmd_obj.run() File "build/bdist.linux-i686/egg/setuptools/command/install_lib.py", line 20, in run File "/home/agrimstr/ACSPython/lib/python2.6/distutils/command/install_lib.py", line 113, in build self.run_command('build_ext') File "/home/agrimstr/ACSPython/lib/python2.6/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/home/agrimstr/ACSPython/lib/python2.6/distutils/dist.py", line 995, in run_command cmd_obj.run() File "build/bdist.linux-i686/egg/setuptools/command/build_ext.py", line 46, in run File "/home/agrimstr/ACSPython/lib/python2.6/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/home/agrimstr/ACSPython/lib/python2.6/distutils/command/build_ext.py", line 449, in build_extensions self.build_extension(ext) File "build/bdist.linux-i686/egg/setuptools/command/build_ext.py", line 175, in build_extension File "/home/agrimstr/ACSPython/lib/python2.6/distutils/command/build_ext.py", line 460, in build_extension ext_path = self.get_ext_fullpath(ext.name) File "/home/agrimstr/ACSPython/lib/python2.6/distutils/command/build_ext.py", line 633, in get_ext_fullpath filename = self.get_ext_filename(modpath[-1]) File "build/bdist.linux-i686/egg/setuptools/command/build_ext.py", line 85, in get_ext_filename KeyError: 'tracer' }}}

Line 105 from setup.py reads as follows:

{{{ Extension("coverage.tracer", sources=["coverage/tracer.c"]) }}}

I've removed the "coverage." and the build runs without error. I've changed "coverage.tracer" to "coverage/tracer" and it also builds without error. However, the resulting tracer.so ends up in different locations each time.

Comments (2)

  1. Ned Batchelder repo owner

    It turns out this is a bug in Python 2.6.3: http://bugs.python.org/issue7064, which was fixed on October 6 for 2.6.4: http://svn.python.org/view/python/branches/release26-maint/Lib/distutils/command/build_ext.py?r1=75256&r2=75255&pathrev=75256

    You can patch your distutils/command/build_ext.py using the above changeset if you like. If you don't get the C extension, everything will still work, it will just be (much) slower to measure coverage.

  2. Anonymous

    It turns out that this issue is actually a regression from distutils/setuptools. Please ignore this report.

  3. Log in to comment