Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jan 2012 08:55:43 GMT
From:      Kevin McAleavey <kevin.mcaleavey@knosproject.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/163948: Python incompatibility on ports: deskutils/calibre
Message-ID:  <201201090855.q098thIL020412@red.freebsd.org>
Resent-Message-ID: <201201090900.q0990RB2020410@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         163948
>Category:       misc
>Synopsis:       Python incompatibility on ports: deskutils/calibre
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 09 09:00:27 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Kevin McAleavey
>Release:        9.0-RC3, but *any*
>Organization:
KNOS Project
>Environment:
Not required here
>Description:
Calibre uses Python 2.7. However, many ports/packages are now using Python 3.x. Calibre is not compatible with 3.x versions of python, and when packages/ports are added which use Python 3, the default scripts in calibre want to use python 3.2 (currently) which are hopelessly incompatible with code written for 2.7 as is calibre and likely others as well. Calibre is broken when 3.x version of python is in the environment.


>How-To-Repeat:
Install anything which adds Python 3.2 such as /graphics/blender and calibre no longer loads with dyntax errors in python 3.2.
>Fix:
Spoke to Kovid Goyal, developer of calibre and he *insists* that his /usr/bin/python scripts all have "#!/usr/bin/env python2" in the scripts that he generates. In BSD however, each script is marked with "#!/usr/bin/env python" instead, which by default will call 3.2 and break.

Obviously "python2" was modified for BSD since "python2" will not call the 2.7 python which is shipped with this port/package. Kovid suggests the following:

calibre uses #!/usr/bin/env python2
It has for a long time. How did you get a version that uses bare python? I'm afraid I don't maintain the BSD calibre packages, you should contact Rusty. I will say that having a python2 symlink pointing to the latest python2 binary is good practice and should be encouraged. See http://www.python.org/dev/peps/pep-0394/

Attempted to edit the offending calls, and "python2" fails, however "python2.7" *works* and calls properly where that is in the header. Since python2.7 is shipped with the port/package, HIGHLY recommend modifying those files to call python2.7 in the header so long as PY27 is shipped WITH the port/package.

Lovid has *NO* intentions of supporting PY3.x in the near future, so this would be a long-term solution for this port.



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201090855.q098thIL020412>