cvs2svn.py can't access cvs db
Roman Schlegel
romanschlegel at hotmail.com
Mon May 10 10:32:10 EDT 2004
I found the problem. :-)
romanschlegel at hotmail.com (Roman Schlegel) wrote in message news:<fa50eff1.0405042350.60ab4bf2 at posting.google.com>...
...
> line 293, in hashopen
> d.open(file, db.DB_HASH, flags, mode)
> bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- DB_TRUNCATE
> illegal with locking specified')
> ...
This is caused by a minor version conflict of the Python Bindings
(bsddb3-4.2.4) and the Berkeley DB itself (db-4.2.52)! The change log
of Berkeley DB 4.2.52 says "9. Fix a bug to now disallow DB_TRUNCATE
on opens in locking environments, since we cannot prevent race
conditions. In the absence of locking and transactions, DB_TRUNCATE
will truncate ANY file for which the user has appropriate permissions.
[#7345]". I believe the module dbshelve.py of the pybsddb tries with
"open" in mode 'n' exactly this disallowed truncate.
There are two possible ways to solve the problem:
Solution One: Download an older Version of the Berkeley DB and install
everything again.
Solution Two (the short way): just don't use mode 'n' to open a db.
This can be avoided easily in the script cvs2svn.py at line 188:
replace the variable "mode" with the constant "'c'":
187 class Database:
188 def __init__(self, filename, 'c'): #mode):
189 self.db = anydbm.open(filename, mode)
More information about the Python-list
mailing list