summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-05-22 08:00:40 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-05-22 08:00:40 (GMT)
commit80cb186b4990b7b4c7a6acd8592ec10ad1b39d3a (patch)
tree8162df3aeb12a193ccb2424708b856721e04bb32 /Lib/sqlite3
parentd9ac81765e2c6e3973712775a7e8916747a266d6 (diff)
downloadcpython-80cb186b4990b7b4c7a6acd8592ec10ad1b39d3a.zip
cpython-80cb186b4990b7b4c7a6acd8592ec10ad1b39d3a.tar.gz
cpython-80cb186b4990b7b4c7a6acd8592ec10ad1b39d3a.tar.bz2
Issue #24257: Fixed segmentation fault in sqlite3.Row constructor with faked
cursor type.
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/test/factory.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/factory.py b/Lib/sqlite3/test/factory.py
index 0813a13..f4b8428 100644
--- a/Lib/sqlite3/test/factory.py
+++ b/Lib/sqlite3/test/factory.py
@@ -170,6 +170,14 @@ class RowFactoryTests(unittest.TestCase):
self.assertEqual(list(reversed(row)), list(reversed(as_tuple)))
self.assertIsInstance(row, Sequence)
+ def CheckFakeCursorClass(self):
+ # Issue #24257: Incorrect use of PyObject_IsInstance() caused
+ # segmentation fault.
+ class FakeCursor(str):
+ __class__ = sqlite.Cursor
+ cur = self.con.cursor(factory=FakeCursor)
+ self.assertRaises(TypeError, sqlite.Row, cur, ())
+
def tearDown(self):
self.con.close()