[Python-bugs-list] [ python-Bugs-486278 ] SystemError: Python/getargs.c:1086: bad

noreply@sourceforge.net noreply@sourceforge.net
Wed, 28 Nov 2001 12:58:27 -0800


Bugs item #486278, was opened at 2001-11-27 17:13
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=486278&group_id=5470

Category: Extension Modules
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Tim Peters (tim_one)
Summary: SystemError: Python/getargs.c:1086: bad

Initial Comment:
This looks like a new problem introduced in 2.2b2
(or something has changed in the way we are to 
write extention modules in C)...I'm using Solaris 2.6
with no configure options other then --prefix=...

I started with two fresh builds and copied the same
files their proper places.  One was Python-2.2b1 and
the other was Python-2.2b2.  My extention module
is fairly a fairly simple conversion utility.

Both builds complete cleanly.  Here is the output
from 2.2b1:

-----------------------
Python 2.2b1 (#1, Nov 27 2001, 19:28:20) 
[GCC 2.9-cisco-98r1] on sunos5
Type "help", "copyright", "credits" or "license" for
more information.
>>> 
>>> import Cstimbase
>>> Cstimbase.hex2wire('aaff11')
'\xaa\xff\x11'
>>> x = Cstimbase.hex2wire('aaff11')
>>> Cstimbase.wire2hex(x)
'aaff11'
>>> 
---------------------------

Here is the exact same module running in 2.2b2:

-------------------------------
Python 2.2b2 (#1, Nov 27 2001, 16:42:01) 
[GCC 2.9-cisco-98r1] on sunos5
Type "help", "copyright", "credits" or "license" for
more information.
>>> import Cstimbase
>>> x = Cstimbase.hex2wire('aaff11')
>>> Cstimbase.wire2hex(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
SystemError: Python/getargs.c:1086: bad argument to
internal function
>>> 
-----------------------------

So what changed in the way you write C extention 
modules?

Thanks,
Sam (stannous@employees.org)



----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-11-28 12:58

Message:
Logged In: NO 

You're correct...I fixed my code and it's fine now.
(when 2.2 final is released, a blurb in the 
CHANGES file that states that new sanity checks 
are being done would be nice....either that or a 
slightly more meaningful error message ;-)

Please close this bug.

Thanks again,
Sam

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-11-27 19:49

Message:
Logged In: YES 
user_id=31435

Do you call PyArg_ParseTupleAndKeywords() in your 
extension?  The error you're seeing is a new sanity check, 
verifying that the number of keyword args passed in kwlist 
is no larger than the number of argument codes passed in 
the format string.  It didn't used to check this, and it 
was possible for Python to dump core as a result.  Please 
check all your uses of ParseTupleAndKeywords() -- I can't 
do it for you without seeing your code.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=486278&group_id=5470