diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2006-04-12 20:16:56 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2006-04-12 20:16:56 (GMT) |
commit | 14c6b4626f4e06a28a043bc41737389cd3951181 (patch) | |
tree | bfc423f1fe0689864f47102a5be03fa6bed6ff5d /Lib/bsddb | |
parent | 55d031ef23ac8f6e7cfe823f62c9e4f627e7b431 (diff) | |
download | cpython-14c6b4626f4e06a28a043bc41737389cd3951181.zip cpython-14c6b4626f4e06a28a043bc41737389cd3951181.tar.gz cpython-14c6b4626f4e06a28a043bc41737389cd3951181.tar.bz2 |
Closes bug #1149413
Using None for a filename with the 'n' flag when calling bsddb.btopen
would cause an error while checking if the file None existed. error
not likely to be seen as anyone using None for a filename would likely
use the 'c' flag in the first place.
Diffstat (limited to 'Lib/bsddb')
-rw-r--r-- | Lib/bsddb/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/bsddb/__init__.py b/Lib/bsddb/__init__.py index d3ee773..68f1032 100644 --- a/Lib/bsddb/__init__.py +++ b/Lib/bsddb/__init__.py @@ -358,7 +358,7 @@ def _checkflag(flag, file): #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): + if file is not None and os.path.isfile(file): os.unlink(file) else: raise error, "flags should be one of 'r', 'w', 'c' or 'n'" |