Comment 12 for bug 75557

Revision history for this message
Mattia Belletti (redglow) wrote :

I'm looking at debian version of this, but I think the same. The problem for me was a not-so-robust way of getting the default version of python from pyversions.py:

_default_version = None
def default_version(version_only=False):
    global _default_version
    if not _default_version:
        _default_version = link = os.readlink('/usr/bin/python')
    if version_only:
        return _default_version[6:]
    else:
        return _default_version

if the /usr/bin/python symlink is the usual stuff like 'python2.4', everything's fine, but if it's something longer like '/usr/bin/python2.4' it breaks. So, it's enough to change the "return _default_version[6:]" onto something more flexible like:

        return re.match(r'.*(\d+\.\d+)', _default_version).group(1)

In attachment, a patch which does exactly this.