Skip to content

Commit fba11b8

Browse files
ZackerySpytzmiss-islington
authored andcommitted
bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (pythonGH-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 fba11b8

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ 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+
self.addCleanup(db.Close)
49+
feature = msilib.Feature(db, 0, 'Feature', 'A feature', 'Python')
50+
cab = msilib.CAB('CAB')
51+
dir = msilib.Directory(db, cab, None, TESTFN, 'TARGETDIR',
52+
'SourceDir', 0)
53+
dir.start_component(None, feature, None, 'keyfile')
54+
4655

4756
class Test_make_id(unittest.TestCase):
4857
#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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy