cournape/Bento

Crash on configure: list index out of range

Closed this issue · 3 comments

C:\Documents and Settings\cabrown4\My Documents\Python\Medussa-dev\pymedussa>bentomaker configure
  File "c:\python27\lib\site-packages\bentomakerlib\bentomaker.py", line 311, in noexc_main
    ret = main(argv)
  File "c:\python27\lib\site-packages\bentomakerlib\bentomaker.py", line 124, in main
    _wrapped_main(popts)
  File "c:\python27\lib\site-packages\bentomakerlib\bentomaker.py", line 129, in _wrapped_main
    mods = set_main()
  File "c:\python27\lib\site-packages\bentomakerlib\bentomaker.py", line 98, in set_main
    pkg = pkg_cache.get_package(BENTO_SCRIPT)
  File "c:\python27\lib\site-packages\bento\core\package_cache.py", line 97, in get_package
    return _create_package_nocached(filename, user_flags, self.db)
  File "c:\python27\lib\site-packages\bento\core\package_cache.py", line 145, in _create_package_noc
ached
    pkg, options = _create_objects_no_cached(filename, user_flags, db)
  File "c:\python27\lib\site-packages\bento\core\package_cache.py", line 167, in _create_objects_no_
cached
    pkg, files = _raw_to_pkg(raw, user_flags, filename)
  File "c:\python27\lib\site-packages\bento\core\package_cache.py", line 157, in _raw_to_pkg
    kw, files = raw_to_pkg_kw(raw, user_flags, filename)
  File "c:\python27\lib\site-packages\bento\core\package.py", line 110, in raw_to_pkg_kw
    d = build_ast_from_raw_dict(raw_dict, user_flags)
  File "c:\python27\lib\site-packages\bento\core\parser\misc.py", line 24, in build_ast_from_raw_dic
t
    res = ast_walk(raw_dict, dispatcher)
  File "c:\python27\lib\site-packages\bento\core\parser\nodes.py", line 76, in ast_walk
    return _walker(root)
  File "c:\python27\lib\site-packages\bento\core\parser\nodes.py", line 65, in _walker
    children.append(_walker(c))
  File "c:\python27\lib\site-packages\bento\core\parser\nodes.py", line 70, in _walker
    return func(walked_tree)
  File "c:\python27\lib\site-packages\bento\core\parser\visitor.py", line 222, in library
    for c in [node.children[0]] + node.children[1]:
bentomaker: Error: bentomaker crashed (uncaught exception : list index
 out of range).
Please report this on bento issue tracker:
    http://github.com/cournape/bento/issues

C:\Documents and Settings\cabrown4\My Documents\Python\Medussa-dev\pymedussa>

info file (autogenerated with bentomaker convert):

Name: medussa
Version: 1.0
Summary: Medussa: A cross-platform high-level audio library
Url: http://www.medussa.us
DownloadUrl: UNKNOWN
Description:      Medussa is a cross-platform, high-performance, high-level audio library
     based on Port Audio and libsndfile. 
     
Author: Christopher A. Brown, Joseph K. Ranweiler
AuthorEmail: c-b /at/ asu.edu
Maintainer: Christopher Brown
MaintainerEmail: c-b /at/ asu.edu
License: GPL
Platforms: Win32,Linux
Classifiers:
    License :: OSI Approved :: GNU General Public License (GPL),
    Programming Language :: Python,
    Operating System :: Microsoft :: Windows,
    Operating System :: POSIX,
    Operating System :: MacOS :: MacOS X,
    Programming Language :: Python,
    Programming Language :: Python :: 2.6,
    Programming Language :: Python :: 2.7,
    Environment :: Console,
    Development Status :: 4 - Beta,
    Intended Audience :: Developers,
    Intended Audience :: Science/Research,
    Topic :: Multimedia :: Sound/Audio,
    Topic :: Scientific/Engineering

Path: gendatadir
    Description: Directory for datafiles obtained from distutils conversion
    Default: $sitedir

DataFiles: $sitedir/Lib_site-packages_medussa_lib
    SourceDir: lib
    TargetDir: $sitedir/Lib\site-packages\medussa
    Files:
        medussa.dll,
        portaudio_x86.dll,
        libsndfile-1.dll

Library:

setup.py, in case its helpful:

# -*- coding: utf-8 -*-
from distutils.core import setup
import platform
from distutils.sysconfig import get_python_lib
from os.path import join

medussa_package = ['medussa']
medussa_package_dir = 'src/medussa'
medussa_package_data = ['*.py']
medussa_data_files = []
medussa_data_files_path = ''
medussa_requires = ['numpy (>=1.2)',]

if platform.system() == "Windows":
    medussa_data_files.append('lib/medussa.dll')
    medussa_data_files.append('lib/portaudio_x86.dll')
    medussa_data_files.append('lib/libsndfile-1.dll')
    medussa_data_files_path = join(get_python_lib(prefix=''), 'medussa')
else:
    medussa_data_files.append('lib/libmedussa.so')
    medussa_data_files_path = 'lib'

setup(name='medussa',
    version='1.0',
    description='Medussa: A cross-platform high-level audio library',
    author='Christopher A. Brown, Joseph K. Ranweiler',
    author_email='c-b /at/ asu.edu',
    maintainer = 'Christopher Brown',
    maintainer_email = 'c-b /at/ asu.edu',
    url='http://www.medussa.us',
    packages = medussa_package,
    requires = medussa_requires,
    package_dir={'medussa': medussa_package_dir},
    package_data={'medussa': medussa_package_data},
    data_files=[(medussa_data_files_path, medussa_data_files)],
    keywords = 'sound audio wavplay',
    license = 'GPL',
    platforms = 'Win32, Linux',
    long_description="""\
 Medussa is a cross-platform, high-performance, high-level audio library
 based on Port Audio and libsndfile. 
 """,
    classifiers=[
        "License :: OSI Approved :: GNU General Public License (GPL)",
        "Programming Language :: Python",
        "Operating System :: Microsoft :: Windows",
        "Operating System :: POSIX",
        "Operating System :: MacOS :: MacOS X",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Environment :: Console",
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "Topic :: Multimedia :: Sound/Audio",
        "Topic :: Scientific/Engineering",
    ],
)

Thanks for the bug report. It looks like there are actually two bugs here:

  • convertion error, with an empty library: most likely due the package_dir/package_data stuff in the setup.py, which is messy in distutils and I have not tested much.
  • parser error (from a grammar POV, an empty library section is valid, but I did not handle this correctly further down).

I have fixed the second part of the bug, so that you should not get a stacktrace anymore.

Bento will not package your software correctly yet, though, because the generated bento.info misses critical parts. This one is more complicated to fix because it involves very hackish and fragile code in bento dealing with distutils idiosyncraties - I hope to fix it this WE, though.

Crash is fixed. As for the error in convertion, I am opening a new bug: #74