2.4beta1 distutil problem?

Thomas Heller theller at python.net
Wed Oct 27 11:12:35 EDT 2004


Helmut Jarausch <jarausch at skynet.be> writes:

> Hi,
>
> I'd like to install SCons (http://www.scons.org) on my Linux box.
> There, the cvs version of Python is running.
> Doing as recommended in the README file
>
> export SCONS_LIB_DIR=`pwd`/src/engine
> python src/script/scons.py build/scons
>
> I get after some time
> /usr/local/bin/python build/scons/setup.py bdist_wininst
> running bdist_wininst
> running build
> running build_py
> running build_scripts
> Traceback (most recent call last):
>    File "/Obj/OBJ/Python/SCons/scons/build/scons/setup.py", line 221, in ?
>      apply(distutils.core.setup, (), arguments)
>    File "/usr/local/lib/python2.4/distutils/core.py", line 149, in setup
>      dist.run_commands()
>    File "/usr/local/lib/python2.4/distutils/dist.py", line 946, in
>    run_commands
>      self.run_command(cmd)
>    File "/usr/local/lib/python2.4/distutils/dist.py", line 966, in
>    run_command
>      cmd_obj.run()
>    File "/usr/local/lib/python2.4/distutils/command/bdist_wininst.py",
>    line 127, in run
>      assert self.skip_build, "Should have already checked this"
> AssertionError: Should have already checked this
> scons: *** [build/scons/dist/scons-0.96.win32.exe] Error 1
>  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ^^^^^^^^^
> Remember this is a build on a Linux machine.
>
>
> This install procedure is claimed to work with Python 2.3.x .

Seems like a bug to me.  And it has nothing to do with Linux or not - it
is triggered if the distribution doesn't have any extension modules.

A quick fix is this patch, at least it works for me:

Thomas

Index: bdist_wininst.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_wininst.py,v
retrieving revision 1.54
diff -c -r1.54 bdist_wininst.py
*** bdist_wininst.py	17 Aug 2004 10:15:07 -0000	1.54
--- bdist_wininst.py	27 Oct 2004 15:11:11 -0000
***************
*** 116,135 ****
          install_lib.compile = 0
          install_lib.optimize = 0
  
!         # If we are building an installer for a Python version other
!         # than the one we are currently running, then we need to ensure
!         # our build_lib reflects the other Python version rather than ours.
!         # Note that for target_version!=sys.version, we must have skipped the
!         # build step, so there is no issue with enforcing the build of this
!         # version.
!         target_version = self.target_version
!         if not target_version:
!             assert self.skip_build, "Should have already checked this"
!             target_version = sys.version[0:3]
!         plat_specifier = ".%s-%s" % (get_platform(), target_version)
!         build = self.get_finalized_command('build')
!         build.build_lib = os.path.join(build.build_base,
!                                        'lib' + plat_specifier)
  
          # Use a custom scheme for the zip-file, because we have to decide
          # at installation time which scheme to use.
--- 116,136 ----
          install_lib.compile = 0
          install_lib.optimize = 0
  
!         if self.distribution.has_ext_modules():
!             # If we are building an installer for a Python version other
!             # than the one we are currently running, then we need to ensure
!             # our build_lib reflects the other Python version rather than ours.
!             # Note that for target_version!=sys.version, we must have skipped the
!             # build step, so there is no issue with enforcing the build of this
!             # version.
!             target_version = self.target_version
!             if not target_version:
!                 assert self.skip_build, "Should have already checked this"
!                 target_version = sys.version[0:3]
!             plat_specifier = ".%s-%s" % (get_platform(), target_version)
!             build = self.get_finalized_command('build')
!             build.build_lib = os.path.join(build.build_base,
!                                            'lib' + plat_specifier)
  
          # Use a custom scheme for the zip-file, because we have to decide
          # at installation time which scheme to use.



More information about the Python-list mailing list