summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-05-31 16:43:13 (GMT)
committerSteve Dower <steve.dower@python.org>2019-05-31 16:43:13 (GMT)
commitc8d5bf6c3fa09b43f6a5ee779d493d251dbcc53c (patch)
tree44a1e31c84e4657a006f24351cc5427bb0aa3548
parent4612671df2742eade8ecf8003a6ce1247973c135 (diff)
downloadcpython-c8d5bf6c3fa09b43f6a5ee779d493d251dbcc53c.zip
cpython-c8d5bf6c3fa09b43f6a5ee779d493d251dbcc53c.tar.gz
cpython-c8d5bf6c3fa09b43f6a5ee779d493d251dbcc53c.tar.bz2
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().
-rw-r--r--Lib/msilib/__init__.py2
-rw-r--r--Lib/test/test_msilib.py9
-rw-r--r--Misc/NEWS.d/next/Library/2019-05-30-16-16-47.bpo-12639.TQFOR4.rst2
3 files changed, 12 insertions, 1 deletions
diff --git a/Lib/msilib/__init__.py b/Lib/msilib/__init__.py
index 8c5251d..0bc8dd9 100644
--- a/Lib/msilib/__init__.py
+++ b/Lib/msilib/__init__.py
@@ -273,7 +273,7 @@ class Directory:
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
diff --git a/Lib/test/test_msilib.py b/Lib/test/test_msilib.py
index 4aa4753..265eaea 100644
--- a/Lib/test/test_msilib.py
+++ b/Lib/test/test_msilib.py
@@ -83,6 +83,15 @@ class MsiDatabaseTestCase(unittest.TestCase):
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
diff --git a/Misc/NEWS.d/next/Library/2019-05-30-16-16-47.bpo-12639.TQFOR4.rst b/Misc/NEWS.d/next/Library/2019-05-30-16-16-47.bpo-12639.TQFOR4.rst
new file mode 100644
index 0000000..aade912
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-05-30-16-16-47.bpo-12639.TQFOR4.rst
@@ -0,0 +1,2 @@
+:meth:`msilib.Directory.start_component()` no longer fails if *keyfile* is
+not ``None``.