RE: [Spambayes] Question (or possibly a bug report)

File "E:\src\spambayes\Outlook2000\dialogs\AsyncDialog.py", line 45, in set_stages assert (abs(start_pos-1.0)) < 0.001, \ AssertionError: Proportions must add to 1.0 (1.0,(('', 1.0),))
That one is still baffling to me, for reasons explained in great detail before (if none of the float literals in this file get screwed, *or* if all of them get screwed by locale, this assert shouldn't fail -- locale has to be screwing up some of the float literals but not others, and that possibility remains baffling to me). Note that I checked in a new version of this assert that displays more info when it fails.
I tried with that version, and then added a print of my own. I get: 1.0 0.0 0.0 0.0 False Traceback (most recent call last): [...] File "D:\cvs\spambayes\spambayes\Outlook2000\dialogs\AsyncDialog.py", line 46, in set_stages assert abs(start_pos-1.0) < 0.001, ( AssertionError: Proportions must add to 1.0 (1.0,(('', 1.0),),0.0) I added as line 45: print start_pos, start_pos-1.0, abs(start_pos-1.0), 0.001, 0.0 < 0.001 So it's 0.0 < 0.001 that fails. Got to go to a meeting now, will try more afterwards. =Tony Meyer

[Meyer, Tony] OK, you did this print: print start_pos, start_pos-1.0, abs(start_pos-1.0), 0.001, 0.0 < 0.001 and it displayed 1.0 0.0 0.0 0.0 False
... So it's 0.0 < 0.001 that fails.
And specifically because "0.001" is being treated as exactly 0. Which locale was in effect? This is starting to get odd <wink>.
participants (2)
-
Meyer, Tony
-
Tim Peters