[Patches] [ python-Patches-1024670 ] Error when int sent to PyLong_AsUnsignedLong

SourceForge.net noreply at sourceforge.net
Wed Sep 8 23:03:12 CEST 2004


Patches item #1024670, was opened at 2004-09-08 14:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1024670&group_id=5470

Category: Core (C code)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Clinton R. Nixon (crnixon)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error when int sent to PyLong_AsUnsignedLong

Initial Comment:
When sending a Python integer as an argument to
PyLong_AsUnsignedLong, the following error occurs

SystemError: Objects/longobject.c:240: bad argument to
internal function

This error comes from the fact that
PyLong_AsUnsignedLong, unlike PyLong_AsLong, does not
check to see if the number is a long or integer, but
only a long.

This patch checks to see if the number is an integer,
and if so, calls PyInt_AsUnsignedLongMask.

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

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


More information about the Patches mailing list