summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-06-25 09:12:41 (GMT)
committerGitHub <noreply@github.com>2020-06-25 09:12:41 (GMT)
commit3f4de44cf7f3da754efbbc0e70feabf3b9384dce (patch)
tree0599d1772779e255e2000c4a94a931d53f21f3ce /Lib
parentec05a7feed120503a3ad2dd4547eea2aa9a81dae (diff)
downloadcpython-3f4de44cf7f3da754efbbc0e70feabf3b9384dce.zip
cpython-3f4de44cf7f3da754efbbc0e70feabf3b9384dce.tar.gz
cpython-3f4de44cf7f3da754efbbc0e70feabf3b9384dce.tar.bz2
bpo-41074: Fix support of non-ASCII names and SQL in msilib. (GH-21126)
* Fix support of non-ASCII names in functions OpenDatabase() and init_database(). * Fix support of non-ASCII SQL in method Database.OpenView(). (cherry picked from commit 55939b1708d6fc0d36d2be11ccdc6bf207e1bd41) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_msilib.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_msilib.py b/Lib/test/test_msilib.py
index f9bd0da..153a8ac 100644
--- a/Lib/test/test_msilib.py
+++ b/Lib/test/test_msilib.py
@@ -1,13 +1,13 @@
""" Test suite for the code in msilib """
import os
import unittest
-from test.support import TESTFN, import_module, unlink
+from test.support import TESTFN, FS_NONASCII, import_module, unlink
msilib = import_module('msilib')
import msilib.schema
def init_database():
- path = TESTFN + '.msi'
+ path = TESTFN + (FS_NONASCII or '') + '.msi'
db = msilib.init_database(
path,
msilib.schema,
@@ -42,6 +42,16 @@ class MsiDatabaseTestCase(unittest.TestCase):
)
self.addCleanup(unlink, db_path)
+ def test_view_non_ascii(self):
+ db, db_path = init_database()
+ view = db.OpenView("SELECT 'ß-розпад' FROM Property")
+ view.Execute(None)
+ record = view.Fetch()
+ self.assertEqual(record.GetString(1), 'ß-розпад')
+ view.Close()
+ db.Close()
+ self.addCleanup(unlink, db_path)
+
def test_summaryinfo_getproperty_issue1104(self):
db, db_path = init_database()
try: