Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 417397 - app-emulation/playonlinux-4.0.14 fails when python-3.x is active, uses internal python detection
Summary: app-emulation/playonlinux-4.0.14 fails when python-3.x is active, uses intern...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-24 16:42 UTC by Ben Kohler
Modified: 2012-06-16 19:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Kohler gentoo-dev 2012-05-24 16:42:48 UTC
playonlinux supplies a bash script /usr/share/games/playonlinux/playonlinux which has an internal python detection, where it sets PythonBin based on the first hit from `which python` then `which python2`, and then a few more versions.  So on gentoo with python3.x active, it WILL be used, even with the python2 hashbangs.

Unfortunately the script just tries "$PythonBin mainwindow.py" and when that fails it dumbly drops back to python2.6, this 2.6 is hardcoded.  And 2.6 will be missing, on any recent system, of course.

The simplest fix I see is to change the 'export PYTHON="python"' line to python2, as this script should NOT be looking for the system default python, but the default python2.

Another option would be to chop out the first block of code where it looks at `which $PYTHON` so the first check is against `which python2` instead.

Reproducible: Always

Steps to Reproduce:
1.  eselect python set python3.2
2.  playonlinux
Actual Results:  
$ playonlinux
  File "mainwindow.py", line 92
    wx.Frame.__init__(self, parent, 1000, title, size = (515,450))
                                                                 ^
TabError: inconsistent use of tabs and spaces in indentation
./playonlinux: line 96: python2.6: command not found


proposed patch:

diff -ur playonlinux/playonlinux playonlinux.new/playonlinux
--- playonlinux/playonlinux	2011-11-19 14:59:15.000000000 -0600
+++ playonlinux.new/playonlinux	2012-05-24 11:41:11.607879082 -0500
@@ -33,7 +33,7 @@
 
 [ "$(uname -s)" = "Linux" ] || die "This script must be run on a linux system"
 
-export PYTHON="python"
+export PYTHON="python2"
 export POL_OS="Linux"
 export UBUNTU_MENUPROXY=0 
 export MACHTYPE
Comment 1 Pacho Ramos gentoo-dev 2012-06-16 19:12:28 UTC
+*playonlinux-4.1.1 (16 Jun 2012)
+
+  16 Jun 2012; Pacho Ramos <pacho@gentoo.org> +playonlinux-4.1.1.ebuild,
+  -playonlinux-4.0.14.ebuild, metadata.xml:
+  Version bump, remove old.
+