Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cb1f74ec
Commit
cb1f74ec
authored
Dec 19, 2013
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20026: Fix the sqlite module to handle correctly invalid isolation level
(wrong type).
parent
cac23a50
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
Lib/sqlite3/test/regression.py
Lib/sqlite3/test/regression.py
+5
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_sqlite/connection.c
Modules/_sqlite/connection.c
+4
-1
No files found.
Lib/sqlite3/test/regression.py
View file @
cb1f74ec
...
...
@@ -330,6 +330,11 @@ class RegressionTests(unittest.TestCase):
datetime
.
datetime
(
2012
,
4
,
4
,
15
,
6
,
0
,
123456
),
])
def
CheckInvalidIsolationLevelType
(
self
):
# isolation level is a string, not an integer
self
.
assertRaises
(
TypeError
,
sqlite
.
connect
,
":memory:"
,
isolation_level
=
123
)
def
suite
():
regression_suite
=
unittest
.
makeSuite
(
RegressionTests
,
"Check"
)
...
...
Misc/NEWS
View file @
cb1f74ec
...
...
@@ -29,6 +29,9 @@ Core and Builtins
Library
-------
- Issue #20026: Fix the sqlite module to handle correctly invalid isolation
level (wrong type).
- Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and
quotechar fields. Original patch by Vajrasky Kok.
...
...
Modules/_sqlite/connection.c
View file @
cb1f74ec
...
...
@@ -109,7 +109,10 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
Py_INCREF
(
isolation_level
);
}
self
->
isolation_level
=
NULL
;
pysqlite_connection_set_isolation_level
(
self
,
isolation_level
);
if
(
pysqlite_connection_set_isolation_level
(
self
,
isolation_level
)
<
0
)
{
Py_DECREF
(
isolation_level
);
return
-
1
;
}
Py_DECREF
(
isolation_level
);
self
->
statement_cache
=
(
pysqlite_Cache
*
)
PyObject_CallFunction
((
PyObject
*
)
&
pysqlite_CacheType
,
"Oi"
,
self
,
cached_statements
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment