bpo-44688: Remove ASCII limitation from sqlite3 collation names (GH-27395)

This commit is contained in:
Erlend Egeberg Aasland 2021-07-29 09:47:56 +02:00 committed by GitHub
parent 8d0647485d
commit 5269c09145
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 60 deletions

View file

@ -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):

View file

@ -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)