#!/usr/bin/env python breaks Python-based Ubuntu packages in the presence of virtualenvs, local installations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
New
|
Undecided
|
Unassigned | ||
c2esp (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
foo2zjs (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
gconf (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
gnome-applets (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
hplip (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
mercurial (Debian) |
Fix Released
|
Unknown
|
|||
mercurial (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
pidgin (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
pitivi (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
pyppd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Currently (as of 11.04, and I suspect in 11.10), several packages I've discovered will potentially break if you have a non-system Python executable on your PATH, e.g. using virtualenv or a custom-built Python. As per the Debian Python Policy (I can't find a similarly thorough document for Ubuntu),
> The preferred specification for the Python interpreter is /usr/bin/python or /usr/bin/pythonX.Y. This ensures that a Debian installation of python is used and all dependencies on additional python modules are met.
> Maintainers should not override the Debian Python interpreter using /usr/bin/env python or /usr/bin/env pythonX.Y. This is not advisable as it bypasses Debian's dependency checking and makes the package vulnerable to incomplete local installations of python.
I think this is reasonable, and also supported by the majority of the Python scripts in my /usr/bin directory.
This also has potential security implications, i.e. someone with only user-level access could override the system Python in a user's ~/.bash_profile and install a malicious version of certain package dependencies.
dwf@barricade:~$ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04
dwf@barricade:~$ grep '#!/usr/bin/env python' /usr/bin/* /usr/sbin/* |cut -d ':' -f 1|xargs dpkg -S
gconf2: /usr/bin/
mercurial-common: /usr/bin/hg-ssh
hplip: /usr/bin/hp-align
hplip: /usr/bin/hp-check
hplip: /usr/bin/hp-clean
hplip: /usr/bin/
hplip: /usr/bin/
hplip: /usr/bin/hp-hpdio
hplip: /usr/bin/hp-info
hplip: /usr/bin/hp-levels
hplip: /usr/bin/hp-makeuri
hplip: /usr/bin/
hplip: /usr/bin/hp-plugin
hplip: /usr/bin/hp-probe
hplip: /usr/bin/hp-query
hplip: /usr/bin/hp-scan
hplip: /usr/bin/hp-setup
hplip: /usr/bin/
hplip: /usr/bin/
hplip: /usr/bin/hp-unload
gnome-applets: /usr/bin/
pitivi: /usr/bin/pitivi
libpurple-bin: /usr/bin/
libpurple-bin: /usr/bin/
hplip: /usr/sbin/hpssd
dwf@barricade:~$ grep '#!/usr/bin/env python' /usr/bin/* /usr/sbin/* |cut -d ':' -f 1 |xargs dpkg -S |cut -d':' -f 1|xargs apt-cache policy
gconf2:
Installed: 2.32.2-0ubuntu2
Candidate: 2.32.2-0ubuntu2
Version table:
*** 2.32.2-0ubuntu2 0
500 http://
100 /var/lib/
hplip:
Installed: 3.11.1-2ubuntu2
Candidate: 3.11.1-2ubuntu2
Version table:
*** 3.11.1-2ubuntu2 0
500 http://
100 /var/lib/
gnome-applets:
Installed: 2.32.1.1-0ubuntu5
Candidate: 2.32.1.1-0ubuntu5
Version table:
*** 2.32.1.1-0ubuntu5 0
500 http://
100 /var/lib/
libpurple-bin:
Installed: 1:2.7.11-1ubuntu2.1
Candidate: 1:2.7.11-1ubuntu2.1
Version table:
*** 1:2.7.11-1ubuntu2.1 0
500 http://
100 /var/lib/
1:
500 http://
pitivi:
Installed: 0.13.5-1ubuntu4
Candidate: 0.13.5-1ubuntu4
Version table:
*** 0.13.5-1ubuntu4 0
500 http://
100 /var/lib/
mercurial-common:
Installed: 1.7.5-1ubuntu1
Candidate: 1.7.5-1ubuntu1
Version table:
*** 1.7.5-1ubuntu1 0
500 http://
100 /var/lib/
Related branches
affects: | hplip (Ubuntu) → ubuntu |
visibility: | private → public |
Changed in hplip (Ubuntu): | |
status: | Triaged → In Progress |
Changed in mercurial (Debian): | |
status: | Unknown → Fix Released |
no longer affects: | ubuntu-sso-client |
tags: | added: natty |
tags: | added: oneiric precise |
no longer affects: | ubuntu-sso-client (Ubuntu) |
affects: | gconf2 (Ubuntu) → gconf (Ubuntu) |
Changed in gnome-applets (Ubuntu): | |
status: | New → Fix Released |
David, thank you for the bug report. Such a report needs to be assigned to the individual packages to make the appropriate maintainers aware of the problem. I have done so now.