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 gregory.p.smith
Recipients gregory.p.smith, tim.peters
Date 2012-02-16.07:57:51
SpamBayes Score 5.7585197e-07
Marked as misclassified No
Message-id <>
Using a 32-bit Python 2.6.5 on a Linux system at work we observed the following:

  File "/.../lib/python2.6/", line 349, in mktemp
    name =
  File "/.../lib/python2.6/", line 134, in next
    letters = [choose(c) for dummy in "123456"]
  File "/.../lib/python2.6/", line 261, in choice
    return seq[int(self.random() * len(seq))]  # raises IndexError if seq is empty
ValueError: cannot convert float NaN to integer

This is rare and hard to reproduce.  The hardware appears to be healthy and this was on a server with ECC.

Some searching reveals that other people have hit this in random.choice in Python 2.7 as well:

The ubuntu developer seems to think this is related to time.time() returning NaN at some point (I haven't looked into that myself).
Date User Action Args
2012-02-16 07:57:53gregory.p.smithsetrecipients: + gregory.p.smith, tim.peters
2012-02-16 07:57:53gregory.p.smithsetmessageid: <>
2012-02-16 07:57:52gregory.p.smithlinkissue14028 messages
2012-02-16 07:57:51gregory.p.smithcreate