Skip to content

Commit

Permalink
bpo-12639: msilib.Directory.start_component() fails if *keyfile* is n…
Browse files Browse the repository at this point in the history
…ot None (GH-13688)

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

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
  • Loading branch information
miss-islington and ZackerySpytz committed May 31, 2019
1 parent fc3b843 commit 49fc57a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/msilib/__init__.py
Expand Up @@ -273,7 +273,7 @@ def start_component(self, component = None, feature = None, flags = None, keyfil
if AMD64:
flags |= 256
if keyfile:
keyid = self.cab.gen_id(self.absolute, keyfile)
keyid = self.cab.gen_id(keyfile)
self.keyfiles[keyfile] = keyid
else:
keyid = None
Expand Down
9 changes: 9 additions & 0 deletions Lib/test/test_msilib.py
Expand Up @@ -83,6 +83,15 @@ def test_get_property_vt_empty(self):
db.Close()
self.addCleanup(unlink, db_path)

def test_directory_start_component_keyfile(self):
db, db_path = init_database()
self.addCleanup(db.Close)
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):
#http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx
Expand Down
@@ -0,0 +1,2 @@
:meth:`msilib.Directory.start_component()` no longer fails if *keyfile* is
not ``None``.

0 comments on commit 49fc57a

Please sign in to comment.