Patchwork [2,of,2] packaging: ensure that --python is an absolute path when building on Windows

login
register
mail settings
Submitter Matt Harbison
Date April 6, 2019, 3:11 a.m.
Message ID <33e7b98103511da6b5bb.1554520296@Envy>
Download mbox | patch
Permalink /patch/39524/
State Accepted
Headers show

Comments

Matt Harbison - April 6, 2019, 3:11 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1554520031 14400
#      Fri Apr 05 23:07:11 2019 -0400
# Node ID 33e7b98103511da6b5bb7fd54ba7ada62e80813c
# Parent  385b6be9f587e3ec2bc04de98d5ffe025a375e8f
packaging: ensure that --python is an absolute path when building on Windows

For whatever reason, even though only python2 is on PATH, passing `python.exe`
causes the later check that it's not py3 to bail out.
Augie Fackler - April 8, 2019, 6:18 p.m.
On Fri, Apr 05, 2019 at 11:11:36PM -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1554520031 14400
> #      Fri Apr 05 23:07:11 2019 -0400
> # Node ID 33e7b98103511da6b5bb7fd54ba7ada62e80813c
> # Parent  385b6be9f587e3ec2bc04de98d5ffe025a375e8f
> packaging: ensure that --python is an absolute path when building on Windows

queued, thanks

Patch

diff --git a/contrib/packaging/inno/build.py b/contrib/packaging/inno/build.py
--- a/contrib/packaging/inno/build.py
+++ b/contrib/packaging/inno/build.py
@@ -30,6 +30,9 @@  if __name__ == '__main__':
 
     args = parser.parse_args()
 
+    if not os.path.isabs(args.python):
+        raise Exception('--python arg must be an absolute path')
+
     if args.iscc:
         iscc = pathlib.Path(args.iscc)
     else:
diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py
--- a/contrib/packaging/wix/build.py
+++ b/contrib/packaging/wix/build.py
@@ -62,6 +62,9 @@  if __name__ == '__main__':
         'version': args.version,
     }
 
+    if not os.path.isabs(args.python):
+        raise Exception('--python arg must be an absolute path')
+
     if args.extra_packages_script:
         kwargs['extra_packages_script'] = args.extra_packages_script
     if args.extra_wxs: