Bug 1303282 - virt-manager shebang hardcoded to /usr/bin/python2
Summary: virt-manager shebang hardcoded to /usr/bin/python2
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: Unspecified
OS: Mac OS
unspecified
low
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-30 05:51 UTC by Jeffrey Walton
Modified: 2016-06-17 17:01 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-17 17:01:23 UTC


Attachments (Terms of Use)

Description Jeffrey Walton 2016-01-30 05:51:18 UTC
Clone of Virt-Manager (https://virt-manager.org/) from GitHub (https://github.com/virt-manager/virt-manager.git). According to INSTALL:

    $ cat INSTALL
      Basic Install
      =============

    For starters, if you just want to run virt-manager/virt-install
    to test out changes, it can be done from the source directory:

        ./virt-manager

Attempting to run it on OS X results in:

    $ ./virt-manager 
    -bash: ./virt-manager: /usr/bin/python2: bad interpreter: No
    such file or directory

According to http://unix.stackexchange.com/a/94198/56041, the expected way to specify Python2 is:

    #!/usr/bin/env python2

It appears to get me past the initial error.

My apologies for the bug. I think this is a trivial improvement, and it should be labeled an enhancement or similar. "Low" bug was as low as I could go...

**********

$ git diff
diff --git a/virt-manager b/virt-manager
index 7a2105f..66dbdc5 100755
--- a/virt-manager
+++ b/virt-manager
@@ -1,4 +1,4 @@
-#!/usr/bin/python2 -tt
+#!/usr/bin/env python2 -tt
 #
 # Copyright (C) 2006, 2014 Red Hat, Inc.
 # Copyright (C) 2006 Daniel P. Berrange <berrange>

Comment 1 Cole Robinson 2016-06-17 17:01:23 UTC
Thanks for the report, fixed upstream now:

commit 47dd38eb3eb604b72687afec7463c7303caac133
Author: Cole Robinson <crobinso>
Date:   Fri Jun 17 12:56:14 2016 -0400

    Use #!/usr/bin/env for python scripts
    
    This is recommended for upstream, but not for downstream, like Fedora.
    So change /usr/bin/env to /usr/bin/python2 at RPM install time to
    match the ideal Fedora config.
    
    https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
    https://bugzilla.redhat.com/show_bug.cgi?id=1303282


Note You need to log in before you can comment on or make changes to this bug.