[Patches] [ python-Patches-645382 ] Don't FPE on FreeBSD...

SourceForge.net noreply@sourceforge.net
Sat, 21 Jun 2003 07:08:36 -0700


Patches item #645382, was opened at 2002-11-28 19:51
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=645382&group_id=5470

Category: Core (C code)
Group: Python 2.3
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Ben Laurie (benl)
Assigned to: Nobody/Anonymous (nobody)
Summary: Don't FPE on FreeBSD...

Initial Comment:
--- Python-2.2.2/Objects/floatobject.c  Sun May 12
17:20:38 2002
+++ Python-2.2.2-ben/Objects/floatobject.c      Thu Nov
28 18:25:04 2002
@@ -645,7 +645,7 @@
        long aslong;            /* (long)wholepart */
 
        (void)modf(x, &wholepart);
-#ifdef RISCOS
+#if defined(RISCOS) || defined(__FreeBSD__)
        /* conversion from floating to integral type
would raise exception */
        if (wholepart>LONG_MAX || wholepart<LONG_MIN) {
                PyErr_SetString(PyExc_OverflowError,
"float too large to convert");


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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-06-21 16:08

Message:
Logged In: YES 
user_id=21627

Since there has been no follow-up, I conclude that Ben is
happy with the current code as-is. Rejecting this patch.

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

Comment By: Tim Peters (tim_one)
Date: 2003-02-13 04:43

Message:
Logged In: YES 
user_id=31435

CVS Python later grew a single patch to python.c that 
turns off FreeBSD's non-standard exception behavior before 
Py_Main is called.  We don't want #ifdef ugliness spreading 
all over the core.  It only turns off one of FreeBSD's oddball 
behaviors, though, so without more info from the FP we 
can't know whether or not it address all the problems he 
saw.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-13 04:30

Message:
Logged In: YES 
user_id=33168

Ben it's not clear to me if this should be applied to 2.3
and/or 2.2.2.  Can you clarify what the problem is and which
version(s) of FreeBSD have the problem.  I tested the
current CVS version on FreeBSD 4.7 (in the SF compile farm)
and did not have any unexpected errors.

Can you add a patch with tests too?

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

Comment By: Ben Laurie (benl)
Date: 2002-12-01 00:03

Message:
Logged In: YES 
user_id=14333

In current CVS the problem is fixed, but others have been
introduced. The enclosed patch fixes the FPE problems found
so far.



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

Comment By: Tim Peters (tim_one)
Date: 2002-11-29 07:31

Message:
Logged In: YES 
user_id=31435

Please try current CVS and see whether the problem is 
already fixed there.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=645382&group_id=5470