[Python-checkins] python/dist/src/Lib/bsddb __init__.py, 1.5.10.4, 1.5.10.5

greg at users.sourceforge.net greg at users.sourceforge.net
Tue Jul 13 23:06:54 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/bsddb
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12062
Modified Files:
 Tag: release23-maint
	__init__.py 
Log Message:
fix for SF bug #897820 (backport of cvs diff -r1.14 -r1.15 __init__.py)
Use os.unlink() instead of the BerkeleyDB DB_TRUNCATE flag.
Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/__init__.py,v
retrieving revision 1.5.10.4
retrieving revision 1.5.10.5
diff -C2 -d -r1.5.10.4 -r1.5.10.5
*** __init__.py	26 Feb 2004 10:21:13 -0000	1.5.10.4
--- __init__.py	13 Jul 2004 21:06:51 -0000	1.5.10.5
***************
*** 53,57 ****
 #----------------------------------------------------------------------
 
! import sys
 
 # for backwards compatibility with python versions older than 2.3, the
--- 53,57 ----
 #----------------------------------------------------------------------
 
! import sys, os
 
 # for backwards compatibility with python versions older than 2.3, the
***************
*** 182,186 ****
 cachesize=None, lorder=None, hflags=0):
 
! flags = _checkflag(flag)
 d = db.DB()
 d.set_flags(hflags)
--- 182,186 ----
 cachesize=None, lorder=None, hflags=0):
 
! flags = _checkflag(flag, file)
 d = db.DB()
 d.set_flags(hflags)
***************
*** 199,203 ****
 pgsize=None, lorder=None):
 
! flags = _checkflag(flag)
 d = db.DB()
 if cachesize is not None: d.set_cachesize(0, cachesize)
--- 199,203 ----
 pgsize=None, lorder=None):
 
! flags = _checkflag(flag, file)
 d = db.DB()
 if cachesize is not None: d.set_cachesize(0, cachesize)
***************
*** 217,221 ****
 rlen=None, delim=None, source=None, pad=None):
 
! flags = _checkflag(flag)
 d = db.DB()
 if cachesize is not None: d.set_cachesize(0, cachesize)
--- 217,221 ----
 rlen=None, delim=None, source=None, pad=None):
 
! flags = _checkflag(flag, file)
 d = db.DB()
 if cachesize is not None: d.set_cachesize(0, cachesize)
***************
*** 233,237 ****
 
 
! def _checkflag(flag):
 if flag == 'r':
 flags = db.DB_RDONLY
--- 233,237 ----
 
 
! def _checkflag(flag, file):
 if flag == 'r':
 flags = db.DB_RDONLY
***************
*** 243,247 ****
 flags = db.DB_CREATE
 elif flag == 'n':
! flags = db.DB_CREATE | db.DB_TRUNCATE
 else:
 raise error, "flags should be one of 'r', 'w', 'c' or 'n'"
--- 243,252 ----
 flags = db.DB_CREATE
 elif flag == 'n':
! flags = db.DB_CREATE
! #flags = db.DB_CREATE | db.DB_TRUNCATE
! # we used db.DB_TRUNCATE flag for this before but BerkeleyDB
! # 4.2.52 changed to disallowed truncate with txn environments.
! if os.path.isfile(file):
! os.unlink(file)
 else:
 raise error, "flags should be one of 'r', 'w', 'c' or 'n'"


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /