unsupported hash version error on py2.4+hashlib

Bug #414041 reported by Sorin Sbarnea
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
doit
Invalid
Undecided
Unassigned

Bug Description

If you install hashlib to python 2.4 in order to be able to run doit you get this:

Traceback (most recent call last):
  File "/usr/bin/doit", line 37, in main
    return m.process()
  File "/usr/lib/python2.4/site-packages/doit/main.py", line 315, in process
    return runner.run()
  File "/usr/lib/python2.4/site-packages/doit/runner.py", line 61, in run
    dependencyManager = Dependency(self.dependencyFile)
  File "/usr/lib/python2.4/site-packages/doit/dependency.py", line 29, in __init__
    self._db = anydbm.open(name,'c')
  File "/usr/lib/python2.4/anydbm.py", line 83, in open
    return mod.open(file, flag, mode)
  File "/usr/lib/python2.4/dbhash.py", line 16, in open
    return bsddb.hashopen(file, flag, mode)
  File "/usr/lib/python2.4/bsddb/__init__.py", line 299, in hashopen
    d.open(file, db.DB_HASH, flags, mode)
DBInvalidArgError: (22, 'Invalid argument -- ./.doit.dbm: unsupported hash version: 9')
Exception exceptions.AttributeError: "'Dependency' object has no attribute '_db'" in <bound method Dependency.__del__ of <doit.dependency.Dependency object at 0xb7ca6b0c>> ignored

Revision history for this message
schettino72 (schettino72) wrote :

From the traceback I can see this that it actually has no relation at all to hashlib. you have some problem with bsddb...

i cant reproduce it... can you debug it?

can you try a simple program that uses bsddb (see http://docs.python.org/library/anydbm.html)

Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

I installed the sources in a clean directory and I do not get the some issue. I suppose this was happening because I copied the sources from windows(py2.6) to linux (py2.4).

Anyway now I get another error:

checker:lib/doit/runner.py => Cmd: pyflakes lib/doit/runner.py
/bin/sh: pyflakes: command not found

Task error => checker:lib/doit/runner.py
========================================
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/doit/runner.py", line 71, in run_tasks
    task.execute()
  File "/usr/lib/python2.4/site-packages/doit/task.py", line 148, in execute
    raise TaskError("Command error: '%s' returned %s" %
TaskError: Command error: '['pyflakes lib/doit/runner.py']' returned 127

Don't you think it would be a good idea to test for requirements? Even if is simple to solve these issues this does not create a good user experience and I'm sure the project is loosing potential users with every step like this.

Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

I managed to make it fully work doing the following:
if py<2.5 install hashlib - good idea to add verification for this.

Installed the other requirements:
yum install python-nose python-setuptools pyflakes
Also, very usefull to check for these too. The error message could even indicate the yum command for installing them.

An even better approach would be to include hashlib, python-nose and pyflakes on the distribution and install them *if* they are not already present.

Revision history for this message
schettino72 (schettino72) wrote :

i am happy it is working for you now.

nose, setuptools, pyflakes... are not dependencies on the project so they will not be included when you install doit. they are used only on development. this dependencies are documented on the README file, though i forgot pychecker and pyflakes...

i dont use centOS. I dont use yum.

btw, how things are going on windows? did you manage to get it working?

doit also has an email list. please use it for questions instead of opening new tickets here.

Changed in doit:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.