[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Well, at least it was an interesting bug report ;-) -- ___ Python tracker ___ ___ Python-bugs-li

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: I think my claim the hardware appears healthy was premature. I misunderstood our initial error report internally on where the code ran and was looking at the wrong host. doh. my bad. Several more of these have been found in the last week and they all su

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Mark Dickinson added the comment: > I'm wondering if the NaN arises in the C code for random(): I don't think that's possible. In the second line: return PyFloat_FromDouble((a*67108864.0+b)*(1.0/9007199254740992.0)); a and b are already C unsigned longs, so no matter what their value, th

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: The hypothesis that time.time() is returning NaN doesn't match the provided traceback. If time.time() had returned NaN, the exception would have happened earlier, on line 113 in random.py: long(time.time() * 256) I'm wondering if the NaN arises in the C

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Mark Dickinson added the comment: The bugs.launchpad.net URL shows a call to 'entropy.choice'. Any idea what 'entropy' is? Could it be that they're using their own Random subclass, not tied to the Python MT implementation? -- ___ Python tracker

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm, this is a little odd. For 2.7 at least, the error message is coming from PyLong_FromDouble in Objects/longobject.c. I can't immediately see how PyLong_FromDouble could be called by the random seeding process. So it seems more likely that the error is r

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- versions: -Python 2.6, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-15 Thread Gregory P. Smith
New submission from Gregory P. Smith : Using a 32-bit Python 2.6.5 on a Linux system at work we observed the following: File "/.../lib/python2.6/tempfile.py", line 349, in mktemp name = names.next() File "/.../lib/python2.6/tempfile.py", line 134, in next letters = [choose(c) for dum