Skip to content

Commit bfc1f60

Browse files
miss-islingtonZackerySpytz
authored andcommitted
[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 c8d5bf6) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
1 parent 103b8d9 commit bfc1f60

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Lib/msilib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def start_component(self, component = None, feature = None, flags = None, keyfil
276276
if Win64:
277277
flags |= 256
278278
if keyfile:
279-
keyid = self.cab.gen_id(self.absolute, keyfile)
279+
keyid = self.cab.gen_id(keyfile)
280280
self.keyfiles[keyfile] = keyid
281281
else:
282282
keyid = None

Lib/test/test_msilib.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ def test_summaryinfo_getproperty_issue1104(self):
4343
sum_info = None
4444
unlink(db_path)
4545

46+
def test_directory_start_component_keyfile(self):
47+
db, db_path = init_database()
48+
feature = msilib.Feature(db, 0, 'Feature', 'A feature', 'Python')
49+
cab = msilib.CAB('CAB')
50+
dir = msilib.Directory(db, cab, None, TESTFN, 'TARGETDIR',
51+
'SourceDir', 0)
52+
dir.start_component(None, feature, None, 'keyfile')
53+
4654

4755
class Test_make_id(unittest.TestCase):
4856
#http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:meth:`msilib.Directory.start_component()` no longer fails if *keyfile* is
2+
not ``None``.

0 commit comments

Comments
 (0)