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

SourceForge.net noreply at sourceforge.net
Sat Sep 18 18:11:09 CEST 2004


Patches item #1024670, was opened at 2004-09-08 23:03
Message generated for change (Comment added) made by loewis
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.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2004-09-18 18:11

Message:
Logged In: YES 
user_id=21627

Why is it desirable to accept ints in PyLong_AsUnsignedLong?

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

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