mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
collation name contains a surrogate character.
This commit is contained in:
parent
0c2d8b8e51
commit
35466c5bce
3 changed files with 22 additions and 5 deletions
|
@ -274,6 +274,13 @@ class RegressionTests(unittest.TestCase):
|
|||
"""
|
||||
self.assertRaises(sqlite.Warning, self.con, 1)
|
||||
|
||||
def CheckCollation(self):
|
||||
def collation_cb(a, b):
|
||||
return 1
|
||||
self.assertRaises(sqlite.ProgrammingError, self.con.create_collation,
|
||||
# Lone surrogate cannot be encoded to the default encoding (utf8)
|
||||
"\uDC80", collation_cb)
|
||||
|
||||
def suite():
|
||||
regression_suite = unittest.makeSuite(RegressionTests, "Check")
|
||||
return unittest.TestSuite((regression_suite,))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue