summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-11-21 05:29:34 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-11-21 05:29:34 (GMT)
commit5890a6a8a68eb5658b7002501ec30e2e30eba144 (patch)
treed1291b4caabb196a7cd1b3eb0eb950ea9f60a2fb /Lib
parentbb4e6dcff51ea03a762f12a1e9c1fbdcfcdbbe38 (diff)
downloadcpython-5890a6a8a68eb5658b7002501ec30e2e30eba144.zip
cpython-5890a6a8a68eb5658b7002501ec30e2e30eba144.tar.gz
cpython-5890a6a8a68eb5658b7002501ec30e2e30eba144.tar.bz2
Backport of 52811:
Bug #1599782: Fix segfault on bsddb.db.DB().type(). The problem is that _DB_get_type() can't be called without the GIL because it calls a bunch of PyErr_* APIs when an error occurs. There were no other cases in this file that it was called without the GIL. Removing the BEGIN/END THREAD around _DB_get_type() made everything work.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/bsddb/test/test_dbobj.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/bsddb/test/test_dbobj.py b/Lib/bsddb/test/test_dbobj.py
index 6799fc9..af494e1 100644
--- a/Lib/bsddb/test/test_dbobj.py
+++ b/Lib/bsddb/test/test_dbobj.py
@@ -69,6 +69,10 @@ class dbobjTestCase(unittest.TestCase):
self.db.close()
self.env.close()
+ def test03_dbobj_type_before_open(self):
+ # Ensure this doesn't cause a segfault.
+ self.assertRaises(db.DBInvalidArgError, db.DB().type)
+
#----------------------------------------------------------------------
def test_suite():