cournape/Bento

Bento fails if DATA_DIR does not exist

Closed this issue · 3 comments

(This is similar to #46.)

If DATA_DIR does not exist, one gets strange errors when first running bento, because the parsetab file cannot be written. E.g.

$ BENTOMAKER_DEBUG=1 ~/PY/bin/bentomaker configure
_PICKLED_PARSETAB /home/astraw/PY/share/parsetab
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bentomakerlib/bentomaker.py", line 363, in noexc_main
    ret = main(argv)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bentomakerlib/bentomaker.py", line 151, in main
    _wrapped_main(popts)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bentomakerlib/bentomaker.py", line 175, in _wrapped_main
    mods = set_main()
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bentomakerlib/bentomaker.py", line 126, in set_main
    pkg = CachedPackage.get_package(BENTO_SCRIPT)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/core/package_cache.py", line 44, in get_package
    return cache.get_package(filename, user_flags)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/core/package_cache.py", line 118, in get_package
    return _create_package_nocached(filename, user_flags, self.db)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/core/package_cache.py", line 167, in _create_package_nocached
    pkg, options = _create_objects_no_cached(filename, user_flags, db)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/core/package_cache.py", line 187, in _create_objects_no_cached
    raw = raw_parse(data, filename)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/core/parser/misc.py", line 16, in raw_parse
    ret = _parse(data)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/core/parser/parser.py", line 53, in parse
    __PARSER = Parser()
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/core/parser/parser.py", line 31, in __init__
    debug=_DEBUG_YACC)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/private/_ply/ply/yacc.py", line 3269, in yacc
    lr.pickle_table(picklefile,signature)
  File "/home/astraw/PY/lib/python2.6/site-packages/bento-0.0.5-py2.6.egg/bento/private/_ply/ply/yacc.py", line 2671, in pickle_table
    outf = open(filename,"wb")
bentomaker: Error: bentomaker crashed (uncaught exception : [Errno 2] No such file or directory: '/home/astraw/PY/share/parsetab').
Please report this on bento issue tracker:
    http://github.com/cournape/bento/issues

Yes, this is clearly a bug. It is not completely trivial to fix, because I need to deal with the case where it is installed as root, and this requires post install hook support.

Hi Andrew, do you still see the issue ?

I do not see it anymore with a checkout of commit 783537d, so I guess it's fixed. Closing the issue.