mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-44688: Remove ASCII limitation from sqlite3 collation names (GH-27395)
This commit is contained in:
parent
8d0647485d
commit
5269c09145
7 changed files with 35 additions and 60 deletions
|
|
@ -40,8 +40,7 @@ class CollationTests(unittest.TestCase):
|
|||
|
||||
def test_create_collation_not_ascii(self):
|
||||
con = sqlite.connect(":memory:")
|
||||
with self.assertRaises(sqlite.ProgrammingError):
|
||||
con.create_collation("collä", lambda x, y: (x > y) - (x < y))
|
||||
con.create_collation("collä", lambda x, y: (x > y) - (x < y))
|
||||
|
||||
def test_create_collation_bad_upper(self):
|
||||
class BadUpperStr(str):
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ class RegressionTests(unittest.TestCase):
|
|||
def test_collation(self):
|
||||
def collation_cb(a, b):
|
||||
return 1
|
||||
self.assertRaises(sqlite.ProgrammingError, self.con.create_collation,
|
||||
self.assertRaises(UnicodeEncodeError, self.con.create_collation,
|
||||
# Lone surrogate cannot be encoded to the default encoding (utf8)
|
||||
"\uDC80", collation_cb)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue