This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Muhammad.Alkarouri
Recipients Kiriakos.Vlahos, Muhammad.Alkarouri, brian.curtin, eric.smith, loewis, mark.dickinson, pitrou, sjmachin, skrah, tim.peters
Date 2010-10-15.03:27:03
SpamBayes Score 6.605827e-15
Marked as misclassified No
Message-id <1287113225.65.0.478794069673.issue9980@psf.upfronthosting.co.za>
In-reply-to
Content
I cam across another issue that was triggered by the same problem. I am explaining it here though I am not sure if it is going to affect the solution one way or the other.

The issue is explained in the post http://stackoverflow.com/questions/3933851/nan-giving-an-error-depending-on-python-startup

Namely, running the command

float('nan')

on a Python (tested with version 2.6.4) embedded in a Delphi 2009 application gives a EInvalidOp Delphi exception.

The solution as given in the link is to change the FPY control word (and revert it back when done).

The issue is important because it may break unexpected Python code. In my case, it broke the command

import json

because of the line

NaN, PosInf, NegInf = float('nan'), float('inf'), float('-inf')

in json.decoder. I have no idea what else may break in the standard library.

The reason I bring this up here is because the problem with the mismatch in FPU control world expectations between Delphi and Python is not localised. Given that the behaviour of float('nan') is assumed to be guaranteed by library developers (see PEP 754), this may come up anywhere.
History
Date User Action Args
2010-10-15 03:27:06Muhammad.Alkarourisetrecipients: + Muhammad.Alkarouri, tim.peters, loewis, sjmachin, mark.dickinson, pitrou, eric.smith, brian.curtin, skrah, Kiriakos.Vlahos
2010-10-15 03:27:05Muhammad.Alkarourisetmessageid: <1287113225.65.0.478794069673.issue9980@psf.upfronthosting.co.za>
2010-10-15 03:27:04Muhammad.Alkarourilinkissue9980 messages
2010-10-15 03:27:03Muhammad.Alkarouricreate