Issue Details (XML | Word | Printable)

Key: MODPYTHON-205
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Graham Dumpleton
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
mod_python

Python version mismatch check and patch level revisions.

Created: 15/Nov/06 02:55 AM   Updated: 05/Apr/09 11:42 PM
Return to search
Component/s: core
Affects Version/s: 3.3.x, 3.2.10
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
When mod_python starts up, it performs a check to confirm whether the version of Python it finds at runtime is the same version as was used to compile mod_python originally. It does this by comparing the value of PY_VERSION defined when mod_python is compiled against the runtime derived version from Py_GetVersion().

Because this is a complete version string, it incorporates the patch level revision as well as the major and minor versions. This means mod_python will issue a warning if Python has been updated, but only by a patch revision. Technically, the ABI for patch level revisions of Python should be compatible and a warning about a version mismatch should NOT be needed in this situation.

Thus, the check should perhaps be changed to only look at major/minor version differences and not patch level revisions.

As an example of this issue, below is bug report from debian bugs list.

Package: libapache2-mod-python
Version: 3.2.10-2
Severity: critical
Justification: breaks unrelated software
[Tue Nov 14 18:28:37 2006] [error] python_init: Python version mismatch, expected '2.4.4c1', found '2.4.4'.
[Tue Nov 14 18:28:37 2006] [error] python_init: Python executable found '/usr/bin/python'.
[Tue Nov 14 18:28:37 2006] [error] python_init: Python path being used '/usr/lib/python24.zip:/usr/lib/python2.4/:/usr/lib/python2.4/plat-linux2:/ usr/lib/python2.4/lib-t
k:/usr/lib/python2.4/lib-dynload'.
[Tue Nov 14 18:28:37 2006] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Tue Nov 14 18:28:37 2006] [notice] mod_python: using mutex_directory /tmp

Need recompile the mod-python :D

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-2-686
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)

Versions of packages libapache2-mod-python depends on:
ii apache2 2.2.3-3.1 Next generation, scalable, extenda
ii apache2-mpm-prefork [apache2 2.2.3-3.1 Traditional model for Apache HTTPD
ii apache2.2-common 2.2.3-3.1 Next generation, scalable, extenda
ii debconf [debconf-2.0] 1.5.8 Debian configuration management sy
ii libc6 2.3.6.ds1-8 GNU C Library: Shared libraries
ii python 2.4.4-1 An interactive high-level object-o
ii python-central 0.5.10 register and build utility for Pyt
ii python2.4 2.4.4-1 An interactive high-level object-o

libapache2-mod-python recommends no packages.

-- debconf information:
  libapache2-mod-python/enable_module: true

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jeff Stuart made changes - 23/Mar/08 03:46 AM
Field Original Value New Value
Comment [ I have encountered this problem as well. I recently installed mod_python 3.3.1 on an Apache 2.2.8 server running on Windows XP and the following is displayed in the error log when I restart Apache:

[Thu Mar 20 00:09:26 2008] [error] python_init: Python version mismatch, expected '2.5', found '2.5.1'.
[Thu Mar 20 00:09:26 2008] [error] python_init: Python executable found 'C:\\Program Files\\xampp\\apache\\bin\\apache.exe'.
[Thu Mar 20 00:09:26 2008] [error] python_init: Python path being used 'C:\\WINDOWS\\system32\\python25.zip;C:\\Program Files\\Python25\\Lib;C:\\Program Files\\Python25\\DLLs;C:\\Program Files\\Python25\\Lib\\lib-tk;

It is somewhat frustrating because there are no options in the installer to configure anything. ]
Graham Dumpleton made changes - 03/Dec/08 10:03 PM
Description When mod_python starts up, it performs a check to confirm whether the version of Python it finds at runtime is the same version as was used to compile mod_python originally. It does this by comparing the value of PY_VERSION defined when mod_python is compiled against the runtime derived version from Py_GetVersion().

Because this is a complete version string, it incorporates the patch level revision as well as the major and minor versions. This means mod_python will issue a warning if Python has been updated, but only by a patch revision. Technically, the ABI for patch level revisions of Python should be compatible and a warning about a version mismatch should be needed in this situation.

Thus, the check should perhaps be changed to only look at major/minor version differences and not patch level revisions.

As an example of this issue, below is bug report from debian bugs list.

Package: libapache2-mod-python
Version: 3.2.10-2
Severity: critical
Justification: breaks unrelated software
[Tue Nov 14 18:28:37 2006] [error] python_init: Python version mismatch, expected '2.4.4c1', found '2.4.4'.
[Tue Nov 14 18:28:37 2006] [error] python_init: Python executable found '/usr/bin/python'.
[Tue Nov 14 18:28:37 2006] [error] python_init: Python path being used '/usr/lib/python24.zip:/usr/lib/python2.4/:/usr/lib/python2.4/plat-linux2:/ usr/lib/python2.4/lib-t
k:/usr/lib/python2.4/lib-dynload'.
[Tue Nov 14 18:28:37 2006] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Tue Nov 14 18:28:37 2006] [notice] mod_python: using mutex_directory /tmp

Need recompile the mod-python :D

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-2-686
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)

Versions of packages libapache2-mod-python depends on:
ii apache2 2.2.3-3.1 Next generation, scalable, extenda
ii apache2-mpm-prefork [apache2 2.2.3-3.1 Traditional model for Apache HTTPD
ii apache2.2-common 2.2.3-3.1 Next generation, scalable, extenda
ii debconf [debconf-2.0] 1.5.8 Debian configuration management sy
ii libc6 2.3.6.ds1-8 GNU C Library: Shared libraries
ii python 2.4.4-1 An interactive high-level object-o
ii python-central 0.5.10 register and build utility for Pyt
ii python2.4 2.4.4-1 An interactive high-level object-o

libapache2-mod-python recommends no packages.

-- debconf information:
  libapache2-mod-python/enable_module: true
When mod_python starts up, it performs a check to confirm whether the version of Python it finds at runtime is the same version as was used to compile mod_python originally. It does this by comparing the value of PY_VERSION defined when mod_python is compiled against the runtime derived version from Py_GetVersion().

Because this is a complete version string, it incorporates the patch level revision as well as the major and minor versions. This means mod_python will issue a warning if Python has been updated, but only by a patch revision. Technically, the ABI for patch level revisions of Python should be compatible and a warning about a version mismatch should NOT be needed in this situation.

Thus, the check should perhaps be changed to only look at major/minor version differences and not patch level revisions.

As an example of this issue, below is bug report from debian bugs list.

Package: libapache2-mod-python
Version: 3.2.10-2
Severity: critical
Justification: breaks unrelated software
[Tue Nov 14 18:28:37 2006] [error] python_init: Python version mismatch, expected '2.4.4c1', found '2.4.4'.
[Tue Nov 14 18:28:37 2006] [error] python_init: Python executable found '/usr/bin/python'.
[Tue Nov 14 18:28:37 2006] [error] python_init: Python path being used '/usr/lib/python24.zip:/usr/lib/python2.4/:/usr/lib/python2.4/plat-linux2:/ usr/lib/python2.4/lib-t
k:/usr/lib/python2.4/lib-dynload'.
[Tue Nov 14 18:28:37 2006] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Tue Nov 14 18:28:37 2006] [notice] mod_python: using mutex_directory /tmp

Need recompile the mod-python :D

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-2-686
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)

Versions of packages libapache2-mod-python depends on:
ii apache2 2.2.3-3.1 Next generation, scalable, extenda
ii apache2-mpm-prefork [apache2 2.2.3-3.1 Traditional model for Apache HTTPD
ii apache2.2-common 2.2.3-3.1 Next generation, scalable, extenda
ii debconf [debconf-2.0] 1.5.8 Debian configuration management sy
ii libc6 2.3.6.ds1-8 GNU C Library: Shared libraries
ii python 2.4.4-1 An interactive high-level object-o
ii python-central 0.5.10 register and build utility for Pyt
ii python2.4 2.4.4-1 An interactive high-level object-o

libapache2-mod-python recommends no packages.

-- debconf information:
  libapache2-mod-python/enable_module: true
Graham Dumpleton added a comment - 05/Apr/09 11:42 PM
Note that the version mismatch warning can only really be ignored if mod_python was compiled against and uses Python shared library. If mod_python links in static Python library, then main interpreter code will indeed be different to all the installed Python extension modules. This may or may not cause problems.

On Windows it is never a problem as always used Python shared library (DLL) on that system.