Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/msilib/__init__.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:meth:`msilib.Directory.start_component()` no longer fails if *keyfile* is
not ``None``.