From: Tim L. <guy...@gm...> - 2010-10-11 18:30:46
|
Peter Landgren wrote: > > I got that code from Benny to make it easier to find certain types of db > errors. > > /Peter > If that is the reason, could I put in a plea (for the next point release) for the update suggested in bug #3975, where I suggest that it might be possible to detect the wrong kind of database without corrupting it as it is opened. (I've got lots of databases that are corrupt because I tried to open them with apparently a different database). I hope that code like that below should check the database before the load. (I suppose that the database could then be closed before the try,try code at present). >>> import bsddb >>> dbenv=bsddb.db.DBEnv() >>> dbenv.open(".", bsddb.db.DB_INIT_TXN | bsddb.db.DB_INIT_MPOOL | >>> bsddb.db.DB_INIT_LOG | bsddb.db.DB_CREATE) >>> db1=bsddb.db.DB(dbenv) >>> db1.open("note.db",flags=bsddb.db.DB_RDONLY,dbtype=bsddb.db.DB_UNKNOWN) -- View this message in context: http://gramps.1791082.n4.nabble.com/Gramps-3-2-4-and-Ubuntu-8-04-tp2990122p2990333.html Sent from the GRAMPS - Dev mailing list archive at Nabble.com. |