diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-22 11:23:23 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-22 11:23:23 (GMT) |
commit | 35466c5bcec27fbcdb702f10e2269c6efef978ae (patch) | |
tree | bc94214b5e695070279aa6033d8d3936ced02ea4 /Lib/sqlite3 | |
parent | 0c2d8b8e51e8bcebd21f8fe33ca0c816e3320c4c (diff) | |
download | cpython-35466c5bcec27fbcdb702f10e2269c6efef978ae.zip cpython-35466c5bcec27fbcdb702f10e2269c6efef978ae.tar.gz cpython-35466c5bcec27fbcdb702f10e2269c6efef978ae.tar.bz2 |
Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
collation name contains a surrogate character.
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r-- | Lib/sqlite3/test/regression.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py index 255bd3f..7d0553d 100644 --- a/Lib/sqlite3/test/regression.py +++ b/Lib/sqlite3/test/regression.py @@ -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,)) |