misc/163948: Python incompatibility on ports: deskutils/calibre

Kevin McAleavey kevin.mcaleavey at knosproject.com
Mon Jan 9 09:00:28 UTC 2012

>Number:         163948
>Category:       misc
>Synopsis:       Python incompatibility on ports: deskutils/calibre
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 09 09:00:27 UTC 2012
>Originator:     Kevin McAleavey
>Release:        9.0-RC3, but *any*
KNOS Project
Not required here
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.

Install anything which adds Python 3.2 such as /graphics/blender and calibre no longer loads with dyntax errors in python 3.2.
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.


More information about the freebsd-bugs mailing list