Opened 11 years ago

Closed 17 months ago

#78 closed defect (fixed)

Add support for Python 3.0

Reported by: Julien ÉLIE Owned by: eagle
Priority: medium Milestone: 2.6.3
Component: build Version:
Severity: normal Keywords:
Cc:

Description (last modified by Julien ÉLIE)

Python 3.0 was released on December, 3rd 2008. 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.

Compilation with Python 3.0 API should also be checked (new functions to use? no issue when building INN with Python support?)

Also be sure that INN compiles fine with Python 2.5.x and 2.6.x.

Change History (9)

comment:1 Changed 11 years ago by Julien ÉLIE

(In [8250]) In Python samples:

  • Remove tabulations for indentations (not allowed by Python 3.0 when spaces are used for that purpose).
  • Add a comment for "except Exception *as* errmsg" (new syntax).
  • Add a comment for memoryview() instead of buffer() which is absent from Python 3.0.
  • Remove occurrences of types.InstanceType? (absent from Python 3.0).
  • Use parenthesis for print().
  • Add a hook to use sys.intern() instead of intern() for Python 3.0.

All the samples are for directly use with Python 2.x.
Commented lines are present wherever the syntax has
changed with Python 3.x.

see #78

comment:2 Changed 11 years ago by Julien ÉLIE

(In [8252]) Add notes about buffers and memory views in documentation.
Also fix a wrong syntax to have access to a dictionary key.

see #78

comment:3 Changed 11 years ago by Julien ÉLIE

Component: generalbuild

Scripts are now compatible with Python 3.0. This ticket is currently only a build issue.

comment:4 Changed 11 years ago by Julien ÉLIE

Milestone: 2.5.02.6.0
Version: 2.4.5

comment:5 Changed 8 years ago by Julien ÉLIE

Also consider dropping support for Python 2.1 and before. It would allow to properly search for the python binary (in m4/python.m4) thanks to the distutils.sysconfig module which appeared in Python 2.2.
The current M4 file does not work with Python 3.

comment:6 Changed 4 years ago by Julien ÉLIE

Milestone: 2.6.02.6.1

comment:7 Changed 4 years ago by Julien ÉLIE

(In [9899]) Python support: use the distutils.sysconfig module at configure time

Drop support for Python 2.1 and before. It will allow to properly search
for the python binary (in m4/python.m4) thanks to the distutils.sysconfig
module which appeared in Python 2.2.0, released in December 2001!
So it is no longer an issue in 2015.

For the record, Python 1.5.2 was currently enough to build INN.

One of the issues fixed is that on several systems, the
/usr/lib/python2.7/config directory does not exist. It can for instance
be /usr/lib/python2.7/config-x86_64-linux-gnu, so the build fails because
"config" is hard-coded in the current way the detection is coded.

see #78

comment:8 Changed 3 years ago by Julien ÉLIE

Milestone: 2.6.12.6.x

Milestone renamed

comment:9 Changed 17 months ago by Julien ÉLIE

Description: modified (diff)
Milestone: 2.6.x2.6.3
Resolution: fixed
Status: newclosed

Fixed in commit [10276]. Tested with Python 2.7, 3.3 and 3.6.

Note: See TracTickets for help on using tickets.