mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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().
This commit is contained in:
parent
152f0b8bee
commit
55939b1708
3 changed files with 21 additions and 8 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue