[INN] #78: Add support for Python 3.0

Julien ÉLIE julien at trigofacile.com
Mon Dec 22 23:24:35 UTC 2008


Hi,

> Python 3.0 was released on December, 3rd.  The syntax currently used in
> Python 2.x scripts shipped with INN is not compatible with the new
> version.  Therefore, innd and nnrpd Python filters should be reviewed and
> made compatible with both Python 2.x and 3.0.

I have checked that INN works well with Python 2.5 and 2.6.
However, there are a few problems with Python 3.0 and I do not know what to do.

The syntax has changed and Python 3.0 is not backward compatible with Python 2.x.
What should we do?

Scripts like nnrpd_auth.py cannot be used because of stuff like:

Python 2.x:

    try:
        ...
    except Exception, errmsg:
        print(errmsg)

Python 3.x:

    try:
        ...
    except Exception as errmsg:
        print(errmsg)


A solution would be to drop errmsg, but it is not appalling...
Do we have to ship two versions of the scripts?

(Maybe we will suffer from the same problem with Perl6...)



As for the C API, it has also changed.  But it is easier to deal with because of #ifdef.
Functions like PyBuffer_FromMemory, PyInt_FromLong, PyString_FromStringAndSize
or PyString_InternFromString do not exist any longer.  I do not know how hard it will be
to fix that.

-- 
Julien ÉLIE

« I don't know if it's what you want, but it's what you get. » (Larry Wall)




More information about the inn-workers mailing list