[ python-Bugs-991812 ] PyArg_ParseTuple can miss errors with warnings as exceptions

SourceForge.net noreply at sourceforge.net
Thu Jul 15 20:45:52 CEST 2004


Bugs item #991812, was opened at 2004-07-15 11:45
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=991812&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: mssf (mssf)
Assigned to: Nobody/Anonymous (nobody)
Summary: PyArg_ParseTuple can miss errors with warnings as exceptions

Initial Comment:
in getargs.c, the convertsimple function returns NULL
if a float warning raised an exception, for example
passing a float to an int conversion.

NULL is interpreted by the caller, converttupple, as a
NON-error

The result is that PyArg_ParseTuple returns TRUE even
though it has left the float unconverted (and the
receiving integer variable containing whatever garbage
it contained before the call)

changing the return on the float error from NULL to
"converterr("integer<i>", arg, msgbuf, bufsize);", as
is done with every other error in this function,
corrects the problem.



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

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


More information about the Python-bugs-list mailing list