Merged revisions 80349 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r80349 | victor.stinner | 2010-04-22 13:23:23 +0200 (jeu., 22 avril 2010) | 3 lines
Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
collation name contains a surrogate character.
........
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py
index da44551..5e315fa 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -183,6 +183,13 @@
"""
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,))