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 <1329379073.39.0.519578524869.issue14028@psf.upfronthosting.co.za>
In-reply-to
Content
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 dummy in "123456"]
  File "/.../lib/python2.6/random.py", 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:  https://bugs.launchpad.net/ubuntu/+source/desktopcouch/+bug/886159

The ubuntu developer seems to think this is related to time.time() returning NaN at some point (I haven't looked into that myself).
History
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: <1329379073.39.0.519578524869.issue14028@psf.upfronthosting.co.za>
2012-02-16 07:57:52gregory.p.smithlinkissue14028 messages
2012-02-16 07:57:51gregory.p.smithcreate