[Patches] [ python-Patches-719359 ] fix test_long failure on OSF/1
SourceForge.net
noreply@sourceforge.net
Sun, 25 May 2003 08:19:20 -0700
Patches item #719359, was opened at 2003-04-10 19:15
Message generated for change (Comment added) made by tim_one
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=719359&group_id=5470
Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Neal Norwitz (nnorwitz)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: fix test_long failure on OSF/1
Initial Comment:
When using cc on OSF/1 V5.1, test_long fails because
PyFloat_FromString() returns a ValueError instead of an
OverflowError when the string is too long. The library
appears to work a bit different. This patch fixes the
problem.
test test_long crashed -- exceptions.ValueError:
invalid literal for float():
12345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345
----------------------------------------------------------------------
>Comment By: Tim Peters (tim_one)
Date: 2003-05-25 11:19
Message:
Logged In: YES
user_id=31435
Sorry, this isn't the right fix. There is no case before this
patch in which PyFloat_FromString() can raise
OverflowError. As the comments say,
/* We don't care about overflow or underflow. If the
platform supports
* them, infinities and signed zeroes (on underflow) are fine.
If this platform is returning DBL_MAX, no problem, lots of
platforms do. I don't know why this platform goes on to
raise ValueError, but the intent is that it return DBL_MAX
and not raise any exception.
Assuming that the test failing is
float(shuge) == int(shuge)
we don't expect the float(shuge) part to raise anything, we
expect the int(shuge) part to raise OverflowError.
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2003-05-25 10:33
Message:
Logged In: YES
user_id=33168
Tim, could you take a quick look at this patch (or
unassign)? It's pretty simple and we could close a bug and
a patch. :-)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=719359&group_id=5470