Skip to content

Commit ca3939c

Browse files
committed
bsddb module updated to version 4.7.0
1 parent 9a8af2d commit ca3939c

6 files changed

Lines changed: 91 additions & 11 deletions

File tree

‎Lib/bsddb/db.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
from _bsddb import __version__
4949

5050
if version() < (3, 2, 0):
51-
raise ImportError, "correct BerkeleyDB symbols not found. Perhaps python was statically linked with an older version?"
51+
raise ImportError, "correct Berkeley DB symbols not found. Perhaps python was statically linked with an older version?"

‎Lib/bsddb/dbtables.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# -- Gregory P. Smith <greg@krypto.org>
1414

1515
# This provides a simple database table interface built on top of
16-
# the Python BerkeleyDB 3 interface.
16+
# the Python Berkeley DB 3 interface.
1717
#
1818
_cvsid = '$Id$'
1919

@@ -139,7 +139,7 @@ def __init__(self, filename, dbhome, create=0, truncate=0, mode=0600,
139139
recover=0, dbflags=0):
140140
"""bsdTableDB(filename, dbhome, create=0, truncate=0, mode=0600)
141141
142-
Open database name in the dbhome BerkeleyDB directory.
142+
Open database name in the dbhome Berkeley DB directory.
143143
Use keyword arguments when calling this constructor.
144144
"""
145145
self.db = None

‎Lib/bsddb/test/test_sequence.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_stat_crash(self) :
110110
self.assertRaises(db.DBNotFoundError, seq.open,
111111
key='id', txn=None, flags=0)
112112

113-
self.assertRaises(db.DBNotFoundError, seq.stat)
113+
self.assertRaises(db.DBInvalidArgError, seq.stat)
114114

115115
d.close()
116116

‎Misc/NEWS‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Extension Modules
4444

4545
- Support for Windows 9x has been removed from the winsound module.
4646

47-
- bsddb module updated to version 4.6.4.
47+
- bsddb module updated to version 4.7.0.
48+
http://www.jcea.es/programacion/pybsddb.htm#bsddb3-4.7.0
4849

4950
- Issue #2858: Fix potential memory corruption when
5051
bsddb.db.DBEnv.lock_get and other bsddb.db object constructors

‎Modules/_bsddb.c‎

Lines changed: 84 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
*
5151
* Gregory P. Smith <greg@krypto.org> was once again the maintainer.
5252
*
53-
* Since January 2008, new maintainer is Jesus Cea <jcea@argo.es>.
53+
* Since January 2008, new maintainer is Jesus Cea <jcea@jcea.es>.
5454
* Jesus Cea licenses this code to PSF under a Contributor Agreement.
5555
*
5656
* Use the pybsddb-users@lists.sf.net mailing list for all questions.
@@ -4129,6 +4129,26 @@ DBEnv_set_flags(DBEnvObject* self, PyObject* args)
41294129
}
41304130

41314131

4132+
#if (DBVER >= 47)
4133+
static PyObject*
4134+
DBEnv_log_set_config(DBEnvObject* self, PyObject* args)
4135+
{
4136+
int err, flags, onoff;
4137+
4138+
if (!PyArg_ParseTuple(args, "ii:log_set_config",
4139+
&flags, &onoff))
4140+
return NULL;
4141+
CHECK_ENV_NOT_CLOSED(self);
4142+
4143+
MYDB_BEGIN_ALLOW_THREADS;
4144+
err = self->db_env->log_set_config(self->db_env, flags, onoff);
4145+
MYDB_END_ALLOW_THREADS;
4146+
RETURN_IF_ERR();
4147+
RETURN_NONE();
4148+
}
4149+
#endif /* DBVER >= 47 */
4150+
4151+
41324152
static PyObject*
41334153
DBEnv_set_data_dir(DBEnvObject* self, PyObject* args)
41344154
{
@@ -4779,8 +4799,13 @@ DBEnv_lock_stat(DBEnvObject* self, PyObject* args)
47794799
MAKE_ENTRY(objs_nowait);
47804800
MAKE_ENTRY(lockers_wait);
47814801
MAKE_ENTRY(lockers_nowait);
4802+
#if (DBVER >= 47)
4803+
MAKE_ENTRY(lock_wait);
4804+
MAKE_ENTRY(lock_nowait);
4805+
#else
47824806
MAKE_ENTRY(locks_wait);
47834807
MAKE_ENTRY(locks_nowait);
4808+
#endif
47844809
MAKE_ENTRY(hash_len);
47854810
#endif
47864811
MAKE_ENTRY(regsize);
@@ -4943,6 +4968,30 @@ DBEnv_set_get_returns_none(DBEnvObject* self, PyObject* args)
49434968
return PyInt_FromLong(oldValue);
49444969
}
49454970

4971+
#if (DBVER >= 40)
4972+
static PyObject*
4973+
DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
4974+
{
4975+
int err;
4976+
char *host;
4977+
long cl_timeout=0, sv_timeout=0;
4978+
4979+
static char* kwnames[] = { "host", "cl_timeout", "sv_timeout", NULL};
4980+
4981+
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|ll:set_rpc_server", kwnames,
4982+
&host, &cl_timeout, &sv_timeout))
4983+
return NULL;
4984+
CHECK_ENV_NOT_CLOSED(self);
4985+
4986+
MYDB_BEGIN_ALLOW_THREADS;
4987+
err = self->db_env->set_rpc_server(self->db_env, NULL, host, cl_timeout,
4988+
sv_timeout, 0);
4989+
MYDB_END_ALLOW_THREADS;
4990+
RETURN_IF_ERR();
4991+
RETURN_NONE();
4992+
}
4993+
#endif
4994+
49464995
#if (DBVER >= 40)
49474996
static PyObject*
49484997
DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
@@ -5075,7 +5124,11 @@ static PyObject*
50755124
DBEnv_rep_get_nsites(DBEnvObject* self, PyObject* args)
50765125
{
50775126
int err;
5127+
#if (DBVER >= 47)
5128+
u_int32_t nsites;
5129+
#else
50785130
int nsites;
5131+
#endif
50795132

50805133
if (!PyArg_ParseTuple(args, ":rep_get_nsites")) {
50815134
return NULL;
@@ -5109,7 +5162,11 @@ static PyObject*
51095162
DBEnv_rep_get_priority(DBEnvObject* self, PyObject* args)
51105163
{
51115164
int err;
5165+
#if (DBVER >= 47)
5166+
u_int32_t priority;
5167+
#else
51125168
int priority;
5169+
#endif
51135170

51145171
if (!PyArg_ParseTuple(args, ":rep_get_priority")) {
51155172
return NULL;
@@ -6094,6 +6151,9 @@ static PyMethodDef DBEnv_methods[] = {
60946151
{"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS},
60956152
{"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS},
60966153
{"set_flags", (PyCFunction)DBEnv_set_flags, METH_VARARGS},
6154+
#if (DBVER >= 47)
6155+
{"log_set_config", (PyCFunction)DBEnv_log_set_config, METH_VARARGS},
6156+
#endif
60976157
{"set_lg_bsize", (PyCFunction)DBEnv_set_lg_bsize, METH_VARARGS},
60986158
{"set_lg_dir", (PyCFunction)DBEnv_set_lg_dir, METH_VARARGS},
60996159
{"set_lg_max", (PyCFunction)DBEnv_set_lg_max, METH_VARARGS},
@@ -6139,6 +6199,10 @@ static PyMethodDef DBEnv_methods[] = {
61396199
#if (DBVER >= 40)
61406200
{"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_VARARGS},
61416201
#endif
6202+
#if (DBVER >= 40)
6203+
{"set_rpc_server", (PyCFunction)DBEnv_set_rpc_server,
6204+
METH_VARARGS||METH_KEYWORDS},
6205+
#endif
61426206
#if (DBVER >= 40)
61436207
{"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
61446208
#if (DBVER >= 42)
@@ -6760,6 +6824,7 @@ DL_EXPORT(void) init_bsddb(void)
67606824
#if (DBVER < 45)
67616825
ADD_INT(d, DB_CACHED_COUNTS);
67626826
#endif
6827+
67636828
#if (DBVER >= 41)
67646829
_addIntToDict(d, "DB_CHECKPOINT", 0);
67656830
#else
@@ -6858,14 +6923,25 @@ DL_EXPORT(void) init_bsddb(void)
68586923
ADD_INT(d, DB_TIME_NOTGRANTED);
68596924
ADD_INT(d, DB_TXN_NOT_DURABLE);
68606925
ADD_INT(d, DB_TXN_WRITE_NOSYNC);
6861-
ADD_INT(d, DB_LOG_AUTOREMOVE);
6862-
ADD_INT(d, DB_DIRECT_LOG);
68636926
ADD_INT(d, DB_DIRECT_DB);
68646927
ADD_INT(d, DB_INIT_REP);
68656928
ADD_INT(d, DB_ENCRYPT);
68666929
ADD_INT(d, DB_CHKSUM);
68676930
#endif
68686931

6932+
#if (DBVER >= 42) && (DBVER < 47)
6933+
ADD_INT(d, DB_LOG_AUTOREMOVE);
6934+
ADD_INT(d, DB_DIRECT_LOG);
6935+
#endif
6936+
6937+
#if (DBVER >= 47)
6938+
ADD_INT(d, DB_LOG_DIRECT);
6939+
ADD_INT(d, DB_LOG_DSYNC);
6940+
ADD_INT(d, DB_LOG_IN_MEMORY);
6941+
ADD_INT(d, DB_LOG_AUTO_REMOVE);
6942+
ADD_INT(d, DB_LOG_ZERO);
6943+
#endif
6944+
68696945
#if (DBVER >= 44)
68706946
ADD_INT(d, DB_DSYNC_DB);
68716947
#endif
@@ -6935,14 +7011,17 @@ DL_EXPORT(void) init_bsddb(void)
69357011
#endif
69367012

69377013
#if (DBVER >= 43)
6938-
ADD_INT(d, DB_DSYNC_LOG);
6939-
ADD_INT(d, DB_LOG_INMEMORY);
69407014
ADD_INT(d, DB_BUFFER_SMALL);
69417015
ADD_INT(d, DB_SEQ_DEC);
69427016
ADD_INT(d, DB_SEQ_INC);
69437017
ADD_INT(d, DB_SEQ_WRAP);
69447018
#endif
69457019

7020+
#if (DBVER >= 43) && (DBVER < 47)
7021+
ADD_INT(d, DB_LOG_INMEMORY);
7022+
ADD_INT(d, DB_DSYNC_LOG);
7023+
#endif
7024+
69467025
#if (DBVER >= 41)
69477026
ADD_INT(d, DB_ENCRYPT_AES);
69487027
ADD_INT(d, DB_AUTO_COMMIT);

‎Modules/bsddb.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
#error "eek! DBVER can't handle minor versions > 9"
106106
#endif
107107

108-
#define PY_BSDDB_VERSION "4.6.5devel2"
108+
#define PY_BSDDB_VERSION "4.7.0"
109109

110110
/* Python object definitions */
111111

0 commit comments

Comments
 (0)