From: Douglas S. B. <db...@cs...> - 2008-11-29 12:29:56
|
[snip] > It is more BSDDB problem, not Python one. > BSDDB since 4.7 version changed log settings, python bindings since > version 4.7 support that. So pre4.7 users can use old settings, post4.7 > users can use new settings, witch leaves as with two more problem: > 1. users with new BSDDB and old pybsddb > 2. users with old BSDDB and new pybssdb > Yours code resolve first problem, but second one is still untested. > > > To leave python out of this maybe something like: > > # clean up unused logs > # BSDDB change log settings using new method with renamed attributes > if db.version() < (4, 7): > # by the book: old method with old attribute > self.env.set_flags(db.DB_LOG_AUTOREMOVE, 1) > # TODO test with new version of pybsddb > else: > if db.__version__ < '4.7': > # undocumented: old method with new attribute (works OK) > self.env.set_flags(db.DB_LOG_AUTO_REMOVE, 1) > else: > # by the book: new method with new attribute > self.env.log_set_config(db.DB_LOG_AUTO_REMOVE, 1) Josip, that sounds more correct, and works for me too: >>> from bsddb import db >>> db.version() (4, 7, 25) >>> db.__version__ '4.4.5.3' I'll make this change in trunk, let others try it, and keep looking for a better solution. Thanks! -Doug > > -- > Josip |