Issue #3659: Values of string subclasses were not handled correctly when used

as bind parameters.

Reviewed by Bejnamin Peterson.
This commit is contained in:
Gerhard Häring 2008-09-22 06:04:51 +00:00
parent d0db98fcd8
commit 6117f423c4
3 changed files with 12 additions and 14 deletions

View file

@ -169,6 +169,12 @@ class RegressionTests(unittest.TestCase):
con = sqlite.connect(":memory:")
setattr(con, "isolation_level", "\xe9")
def CheckStrSubclass(self):
"""
The Python 3.0 port of the module didn't cope with values of subclasses of str.
"""
class MyStr(str): pass
self.con.execute("select ?", (MyStr("abc"),))
def suite():
regression_suite = unittest.makeSuite(RegressionTests, "Check")