[Python-checkins] r63537 - in python/trunk: Lib/bsddb/db.py Lib/bsddb/dbtables.py Lib/bsddb/test/test_sequence.py Misc/NEWS Modules/_bsddb.c Modules/bsddb.h

jesus.cea python-checkins at python.org
Thu May 22 17:27:39 CEST 2008


Author: jesus.cea
Date: Thu May 22 17:27:38 2008
New Revision: 63537

Log:
bsddb module updated to version 4.7.0

Modified:
   python/trunk/Lib/bsddb/db.py
   python/trunk/Lib/bsddb/dbtables.py
   python/trunk/Lib/bsddb/test/test_sequence.py
   python/trunk/Misc/NEWS
   python/trunk/Modules/_bsddb.c
   python/trunk/Modules/bsddb.h

Modified: python/trunk/Lib/bsddb/db.py
==============================================================================
--- python/trunk/Lib/bsddb/db.py	(original)
+++ python/trunk/Lib/bsddb/db.py	Thu May 22 17:27:38 2008
@@ -48,4 +48,4 @@
     from _bsddb import __version__
 
 if version() < (3, 2, 0):
-    raise ImportError, "correct BerkeleyDB symbols not found.  Perhaps python was statically linked with an older version?"
+    raise ImportError, "correct Berkeley DB symbols not found.  Perhaps python was statically linked with an older version?"

Modified: python/trunk/Lib/bsddb/dbtables.py
==============================================================================
--- python/trunk/Lib/bsddb/dbtables.py	(original)
+++ python/trunk/Lib/bsddb/dbtables.py	Thu May 22 17:27:38 2008
@@ -13,7 +13,7 @@
 #   --  Gregory P. Smith <greg at krypto.org>
 
 # This provides a simple database table interface built on top of
-# the Python BerkeleyDB 3 interface.
+# the Python Berkeley DB 3 interface.
 #
 _cvsid = '$Id$'
 
@@ -139,7 +139,7 @@
                  recover=0, dbflags=0):
         """bsdTableDB(filename, dbhome, create=0, truncate=0, mode=0600)
 
-        Open database name in the dbhome BerkeleyDB directory.
+        Open database name in the dbhome Berkeley DB directory.
         Use keyword arguments when calling this constructor.
         """
         self.db = None

Modified: python/trunk/Lib/bsddb/test/test_sequence.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_sequence.py	(original)
+++ python/trunk/Lib/bsddb/test/test_sequence.py	Thu May 22 17:27:38 2008
@@ -110,7 +110,7 @@
             self.assertRaises(db.DBNotFoundError, seq.open,
                     key='id', txn=None, flags=0)
 
-            self.assertRaises(db.DBNotFoundError, seq.stat)
+            self.assertRaises(db.DBInvalidArgError, seq.stat)
 
             d.close()
 

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Thu May 22 17:27:38 2008
@@ -44,7 +44,8 @@
 
 - Support for Windows 9x has been removed from the winsound module.
 
-- bsddb module updated to version 4.6.4.
+- bsddb module updated to version 4.7.0.
+  http://www.jcea.es/programacion/pybsddb.htm#bsddb3-4.7.0
 
 - Issue #2858: Fix potential memory corruption when
   bsddb.db.DBEnv.lock_get and other bsddb.db object constructors

Modified: python/trunk/Modules/_bsddb.c
==============================================================================
--- python/trunk/Modules/_bsddb.c	(original)
+++ python/trunk/Modules/_bsddb.c	Thu May 22 17:27:38 2008
@@ -50,7 +50,7 @@
  *
  * Gregory P. Smith <greg at krypto.org> was once again the maintainer.
  *
- * Since January 2008, new maintainer is Jesus Cea <jcea at argo.es>.
+ * Since January 2008, new maintainer is Jesus Cea <jcea at jcea.es>.
  * Jesus Cea licenses this code to PSF under a Contributor Agreement.
  *
  * Use the pybsddb-users at lists.sf.net mailing list for all questions.
@@ -4129,6 +4129,26 @@
 }
 
 
+#if (DBVER >= 47)
+static PyObject*
+DBEnv_log_set_config(DBEnvObject* self, PyObject* args)
+{
+    int err, flags, onoff;
+
+    if (!PyArg_ParseTuple(args, "ii:log_set_config",
+                          &flags, &onoff))
+        return NULL;
+    CHECK_ENV_NOT_CLOSED(self);
+
+    MYDB_BEGIN_ALLOW_THREADS;
+    err = self->db_env->log_set_config(self->db_env, flags, onoff);
+    MYDB_END_ALLOW_THREADS;
+    RETURN_IF_ERR();
+    RETURN_NONE();
+}
+#endif /* DBVER >= 47 */
+
+
 static PyObject*
 DBEnv_set_data_dir(DBEnvObject* self, PyObject* args)
 {
@@ -4779,8 +4799,13 @@
     MAKE_ENTRY(objs_nowait);
     MAKE_ENTRY(lockers_wait);
     MAKE_ENTRY(lockers_nowait);
+#if (DBVER >= 47)
+    MAKE_ENTRY(lock_wait);
+    MAKE_ENTRY(lock_nowait);
+#else
     MAKE_ENTRY(locks_wait);
     MAKE_ENTRY(locks_nowait);
+#endif
     MAKE_ENTRY(hash_len);
 #endif
     MAKE_ENTRY(regsize);
@@ -4945,6 +4970,30 @@
 
 #if (DBVER >= 40)
 static PyObject*
+DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+{
+    int err;
+    char *host;
+    long cl_timeout=0, sv_timeout=0;
+
+    static char* kwnames[] = { "host", "cl_timeout", "sv_timeout", NULL};
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|ll:set_rpc_server", kwnames,
+                                     &host, &cl_timeout, &sv_timeout))
+        return NULL;
+    CHECK_ENV_NOT_CLOSED(self);
+
+    MYDB_BEGIN_ALLOW_THREADS;
+    err = self->db_env->set_rpc_server(self->db_env, NULL, host, cl_timeout,
+            sv_timeout, 0);
+    MYDB_END_ALLOW_THREADS;
+    RETURN_IF_ERR();
+    RETURN_NONE();
+}
+#endif
+
+#if (DBVER >= 40)
+static PyObject*
 DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
 {
     int err;
@@ -5075,7 +5124,11 @@
 DBEnv_rep_get_nsites(DBEnvObject* self, PyObject* args)
 {
     int err;
+#if (DBVER >= 47)
+    u_int32_t nsites;
+#else
     int nsites;
+#endif
 
     if (!PyArg_ParseTuple(args, ":rep_get_nsites")) {
         return NULL;
@@ -5109,7 +5162,11 @@
 DBEnv_rep_get_priority(DBEnvObject* self, PyObject* args)
 {
     int err;
+#if (DBVER >= 47)
+    u_int32_t priority;
+#else
     int priority;
+#endif
 
     if (!PyArg_ParseTuple(args, ":rep_get_priority")) {
         return NULL;
@@ -6094,6 +6151,9 @@
     {"set_cachesize",   (PyCFunction)DBEnv_set_cachesize,    METH_VARARGS},
     {"set_data_dir",    (PyCFunction)DBEnv_set_data_dir,     METH_VARARGS},
     {"set_flags",       (PyCFunction)DBEnv_set_flags,        METH_VARARGS},
+#if (DBVER >= 47)
+    {"log_set_config",  (PyCFunction)DBEnv_log_set_config,   METH_VARARGS},
+#endif
     {"set_lg_bsize",    (PyCFunction)DBEnv_set_lg_bsize,     METH_VARARGS},
     {"set_lg_dir",      (PyCFunction)DBEnv_set_lg_dir,       METH_VARARGS},
     {"set_lg_max",      (PyCFunction)DBEnv_set_lg_max,       METH_VARARGS},
@@ -6140,6 +6200,10 @@
     {"txn_recover",     (PyCFunction)DBEnv_txn_recover,       METH_VARARGS},
 #endif
 #if (DBVER >= 40)
+    {"set_rpc_server",  (PyCFunction)DBEnv_set_rpc_server,
+        METH_VARARGS||METH_KEYWORDS},
+#endif
+#if (DBVER >= 40)
     {"set_verbose",     (PyCFunction)DBEnv_set_verbose,       METH_VARARGS},
 #if (DBVER >= 42)
     {"get_verbose",     (PyCFunction)DBEnv_get_verbose,       METH_VARARGS},
@@ -6760,6 +6824,7 @@
 #if (DBVER < 45)
     ADD_INT(d, DB_CACHED_COUNTS);
 #endif
+
 #if (DBVER >= 41)
     _addIntToDict(d, "DB_CHECKPOINT", 0);
 #else
@@ -6858,14 +6923,25 @@
     ADD_INT(d, DB_TIME_NOTGRANTED);
     ADD_INT(d, DB_TXN_NOT_DURABLE);
     ADD_INT(d, DB_TXN_WRITE_NOSYNC);
-    ADD_INT(d, DB_LOG_AUTOREMOVE);
-    ADD_INT(d, DB_DIRECT_LOG);
     ADD_INT(d, DB_DIRECT_DB);
     ADD_INT(d, DB_INIT_REP);
     ADD_INT(d, DB_ENCRYPT);
     ADD_INT(d, DB_CHKSUM);
 #endif
 
+#if (DBVER >= 42) && (DBVER < 47)
+    ADD_INT(d, DB_LOG_AUTOREMOVE);
+    ADD_INT(d, DB_DIRECT_LOG);
+#endif
+
+#if (DBVER >= 47)
+    ADD_INT(d, DB_LOG_DIRECT);
+    ADD_INT(d, DB_LOG_DSYNC);
+    ADD_INT(d, DB_LOG_IN_MEMORY);
+    ADD_INT(d, DB_LOG_AUTO_REMOVE);
+    ADD_INT(d, DB_LOG_ZERO);
+#endif
+
 #if (DBVER >= 44)
     ADD_INT(d, DB_DSYNC_DB);
 #endif
@@ -6935,14 +7011,17 @@
 #endif
 
 #if (DBVER >= 43)
-    ADD_INT(d, DB_DSYNC_LOG);
-    ADD_INT(d, DB_LOG_INMEMORY);
     ADD_INT(d, DB_BUFFER_SMALL);
     ADD_INT(d, DB_SEQ_DEC);
     ADD_INT(d, DB_SEQ_INC);
     ADD_INT(d, DB_SEQ_WRAP);
 #endif
 
+#if (DBVER >= 43) && (DBVER < 47)
+    ADD_INT(d, DB_LOG_INMEMORY);
+    ADD_INT(d, DB_DSYNC_LOG);
+#endif
+
 #if (DBVER >= 41)
     ADD_INT(d, DB_ENCRYPT_AES);
     ADD_INT(d, DB_AUTO_COMMIT);

Modified: python/trunk/Modules/bsddb.h
==============================================================================
--- python/trunk/Modules/bsddb.h	(original)
+++ python/trunk/Modules/bsddb.h	Thu May 22 17:27:38 2008
@@ -105,7 +105,7 @@
 #error "eek! DBVER can't handle minor versions > 9"
 #endif
 
-#define PY_BSDDB_VERSION "4.6.5devel2"
+#define PY_BSDDB_VERSION "4.7.0"
 
 /* Python object definitions */
 


More information about the Python-checkins mailing list