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

noreply@sourceforge.net noreply@sourceforge.net
Wed, 23 Aug 2000 07:29:55 -0700


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

Project: Python
Category: Core
Status: Open
Resolution: None
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

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