This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alanh
Recipients alanh
Date 2013-10-22.11:47:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382442448.32.0.170952369524.issue19346@psf.upfronthosting.co.za>
In-reply-to
Content
When building python with static extensions and therefore there are no shared extensions to be built the extension list can be NULL, and therefore 0 length.

This results in this error....

running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/setup.py", line 2017, in <module>
    main()
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/setup.py", line 2011, in main
    'Lib/smtpd.py']
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Lib/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Lib/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Lib/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Lib/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Lib/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Lib/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Lib/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/setup.py", line 266, in build_extensions
    longest = max([len(e.name) for e in self.extensions])
ValueError: max() arg is an empty sequence

To fix I replaced this line in setup.py

        longest = max([len(e.name) for e in self.extensions])

to this...

        longest = 0
        for e in self.extensions:
            longest = max(longest, len(e.name))
History
Date User Action Args
2013-10-22 11:47:28alanhsetrecipients: + alanh
2013-10-22 11:47:28alanhsetmessageid: <1382442448.32.0.170952369524.issue19346@psf.upfronthosting.co.za>
2013-10-22 11:47:28alanhlinkissue19346 messages
2013-10-22 11:47:27alanhcreate