[2.7] bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (GH-13688)

* bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (GH-13688)

msilib.Directory.start_component() was passing an extra argument to CAB.gen_id().
(cherry picked from commit c8d5bf6c3f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
Miss Islington (bot) 2019-05-31 15:39:39 -07:00 committed by Steve Dower
parent 103b8d9f91
commit bfc1f60560
3 changed files with 11 additions and 1 deletions

View File

@ -276,7 +276,7 @@ class Directory:
if Win64: if Win64:
flags |= 256 flags |= 256
if keyfile: if keyfile:
keyid = self.cab.gen_id(self.absolute, keyfile) keyid = self.cab.gen_id(keyfile)
self.keyfiles[keyfile] = keyid self.keyfiles[keyfile] = keyid
else: else:
keyid = None keyid = None

View File

@ -43,6 +43,14 @@ class MsiDatabaseTestCase(unittest.TestCase):
sum_info = None sum_info = None
unlink(db_path) unlink(db_path)
def test_directory_start_component_keyfile(self):
db, db_path = init_database()
feature = msilib.Feature(db, 0, 'Feature', 'A feature', 'Python')
cab = msilib.CAB('CAB')
dir = msilib.Directory(db, cab, None, TESTFN, 'TARGETDIR',
'SourceDir', 0)
dir.start_component(None, feature, None, 'keyfile')
class Test_make_id(unittest.TestCase): class Test_make_id(unittest.TestCase):
#http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx #http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx

View File

@ -0,0 +1,2 @@
:meth:`msilib.Directory.start_component()` no longer fails if *keyfile* is
not ``None``.