This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Can't raise "C API version mismatch" warning
Type: behavior Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: bob.ippolito, brett.cannon, mwh, sonnenburg, terry.reedy
Priority: normal Keywords:

Created on 2004-10-11 07:22 by sonnenburg, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg60581 - (view) Author: Frank Sonnenburg (sonnenburg) Date: 2004-10-11 07:22
See following example (that's what we know): 
# Importing 2.1 module with Python 2.3 
frank@theta:~> python 
Python 2.3+ (#1, Jan  7 2004, 09:17:35) 
[GCC 3.3.1 (SuSE Linux)] on linux2 
Type "help", "copyright", "credits" or "license" for more 
information. 
>>> import sys 
>>> sys.path.insert(0, '/usr/lib/python2.1/lib-dynload') 
>>> import cmath 
__main__:1: RuntimeWarning: Python C API version mismatch 
for module cmath: This Python has API version 1012, module 
cmath has version 1010. 
>>> 
================================== 
Ignoring this warning works without problem, but raising an 
exception will lead to segmentation fault: 
# Starting python with warnings turned into exceptions 
frank@theta:~> python -W error 
Python 2.3+ (#1, Jan  7 2004, 09:17:35) 
[GCC 3.3.1 (SuSE Linux)] on linux2 
Type "help", "copyright", "credits" or "license" for more 
information. 
>>> import sys 
>>> sys.path.insert(0, '/usr/lib/python2.1/lib-dynload') 
>>> import cmath 
Speicherzugriffsfehler (seg fault) 
msg60582 - (view) Author: Bob Ippolito (bob.ippolito) * (Python committer) Date: 2004-10-15 13:31
Logged In: YES 
user_id=139309

It's not valid to use extensions from one major version of Python with 
another, hence the C API Version Mismatch warning.  What do you 
expect?  You're lucky it doesn't segfault sooner :)
msg60583 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-10-15 13:49
Logged In: YES 
user_id=6656

Well, maybe but this still looks like a bug to me.
msg60584 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2004-10-15 22:49
Logged In: YES 
user_id=593130

Do you get same 2.4? (b1 should be out within a day.)
msg60585 - (view) Author: Frank Sonnenburg (sonnenburg) Date: 2004-10-18 09:03
Logged In: YES 
user_id=459347

Still the same for 2.4b1 on SuSE 9.0: 
frank@theta:/backup/users/frank/div/download/python/2.4b1/
theta-SuSE9.0> ./python -W error 
Python 2.4b1 (#1, Oct 18 2004, 10:45:40) 
[GCC 3.3.1 (SuSE Linux)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import sys 
>>> sys.path.insert(0, '/usr/lib/python2.1/lib-dynload') 
>>> import cmath 
Speicherzugriffsfehler 
 
To etrepum: 
I really don't expect a segfault, because Python2.1 is built on my 
machine as well as Python2.3 resp. Python2.4b1 is.  I do would expect 
a program termination, iff there were unsatisfied symbols calling new 
or renamed Python C-API functions. 
 
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 41002
2009-04-02 02:04:40brett.cannonsetstatus: open -> closed
resolution: out of date
2009-02-11 03:03:43ajaksu2setassignee: brett.cannon
type: behavior
nosy: + brett.cannon
2004-10-11 07:22:41sonnenburgcreate