[Python-bugs-list] [Bug #110609] Operator breakage with long int operands (PR#187)

noreply@sourceforge.net noreply@sourceforge.net
Thu, 21 Sep 2000 06:47:14 -0700


Bug #110609, was updated on 2000-Jul-31 14:05
Here is a current snapshot of the bug.

Project: Python
Category: Core
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 5
Summary: Operator breakage with long int operands (PR#187)

Details: Jitterbug-Id: 187
Submitted-By: aa8vb@yahoo.com
Date: Mon, 24 Jan 2000 11:19:11 -0500 (EST)
Version: 1.5.2
OS: IRIX 6.5


This came up a few weeks ago, and bit again in the dumbdbm module last week.
In the dumbdbm module in 1.5.2:

     '\0'*(npos-pos)

(npos-pos) on some OSs will be a long int.  However, the '*' operator won't 
handle a long int.  I can't think of a reason why 'a'*10L should be invalid,
for example.

At issue a few weeks ago was long ints and the '%' operator.  For example:

    >>> str( 0x80000000L )
    '2147483648L'
    >>> "%ld" % 0x80000000L
    OverflowError: long int too long to convert

    >>> hex( 0x80000000L )
    '0x80000000L'
    >>> "%lX" % 0x80000000L
    OverflowError: long int too long to convert

Couldn't % use hex() and str() under the hood, for instance?



====================================================================
Audit trail:
Mon Jan 24 14:28:42 2000	guido	moved from incoming to open

Follow-Ups:

Date: 2000-Sep-16 06:57
By: loewis

Comment:
I believe the first issue is resolved in 2.0b1; '\0' * 10L does work.
-------------------------------------------------------

Date: 2000-Sep-16 16:41
By: loewis

Comment:
A patch for the formatting problem in in

http://sourceforge.net/patch/?func=detailpatch&patch_id=101544&group_id=5470
-------------------------------------------------------

Date: 2000-Sep-21 06:47
By: loewis

Comment:
The PyNumber_Format part is fixed with revision 2.89 of stringobject.c.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=110609&group_id=5470