Issue1052

classification
Title: __int__ returning PyLong = ClassCastException mayhem
Type: crash Severity: normal
Components: Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pjenvey Nosy List: pjenvey
Priority: Keywords:

Created on 2008-06-11.00:01:59 by pjenvey, last changed 2008-11-23.04:18:53 by pjenvey.

Messages
msg3273 (view) Author: Philip Jenvey (pjenvey) Date: 2008-06-11.00:01:57
For PEP 237 I basically had to change __int__ to be able to return 
PyLongs:

Python 2.5.2 (r252:60911, Apr 22 2008, 12:00:45) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> (sys.maxint + 1).__int__()
2147483648L

I think it's definitely necessary, but we cast the result of __int__() 
to PyInteger all over the place. These probably need to all be changed 
to obj.asInt() instead, which returns a Java int and can raise 
OverflowError
msg3823 (view) Author: Philip Jenvey (pjenvey) Date: 2008-11-23.04:18:53
fixed in r5608, r5609
History
Date User Action Args
2008-11-23 04:18:53pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg3823
2008-11-23 04:00:42pjenveysetassignee: pjenvey
2008-06-11 00:02:16pjenveysettype: crash
components: + Core
2008-06-11 00:01:59pjenveycreate