| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cac23a5 commit cb1f74e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -330,6 +330,11 @@ def CheckConvertTimestampMicrosecondPadding(self): | |||
| 330 | 330 | datetime.datetime(2012, 4, 4, 15, 6, 0, 123456), | |
| 331 | 331 | ]) | |
| 332 | 332 | ||
| 333 | + def CheckInvalidIsolationLevelType(self): | ||
| 334 | + # isolation level is a string, not an integer | ||
| 335 | + self.assertRaises(TypeError, | ||
| 336 | + sqlite.connect, ":memory:", isolation_level=123) | ||
| 337 | + | ||
| 333 | 338 | ||
| 334 | 339 | def suite(): | |
| 335 | 340 | regression_suite = unittest.makeSuite(RegressionTests, "Check") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,9 @@ Core and Builtins | |||
| 29 | 29 | Library | |
| 30 | 30 | ------- | |
| 31 | 31 | ||
| 32 | + - Issue #20026: Fix the sqlite module to handle correctly invalid isolation | ||
| 33 | + level (wrong type). | ||
| 34 | + | ||
| 32 | 35 | - Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and | |
| 33 | 36 | quotechar fields. Original patch by Vajrasky Kok. | |
| 34 | 37 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -109,7 +109,10 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject | |||
| 109 | 109 | Py_INCREF(isolation_level); | |
| 110 | 110 | } | |
| 111 | 111 | self->isolation_level = NULL; | |
| 112 | - pysqlite_connection_set_isolation_level(self, isolation_level); | ||
| 112 | + if (pysqlite_connection_set_isolation_level(self, isolation_level) < 0) { | ||
| 113 | + Py_DECREF(isolation_level); | ||
| 114 | + return -1; | ||
| 115 | + } | ||
| 113 | 116 | Py_DECREF(isolation_level); | |
| 114 | 117 | ||
| 115 | 118 | self->statement_cache = (pysqlite_Cache*)PyObject_CallFunction((PyObject*)&pysqlite_CacheType, "Oi", self, cached_statements); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments