Django

Code

Ticket #3007 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] random.getrandbits only available in python 2.4

Reported by: raman Assigned to: adrian
Milestone: Component: Core framework
Version: SVN Keywords: random mail
Cc: gary.wilson@gmail.com Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Changeset 4051* introduced "getrandbits"* from the "random" module.

This method is only available in python 2.4**.

Django installation docs say django runs on python 2.3+. (Noticed this when a page crashed on a python 2.3 django site I was working on ...)

thanks,

raman

*http://code.djangoproject.com/changeset/4051/django/trunk

** http://docs.python.org/lib/module-random.html

Attachments

messageid.patch (1.0 kB) - added by SmileyChris on 11/08/06 21:03:51.
Fallback for Python 2.3 (and caching of server name)

Change History

11/08/06 21:03:51 changed by SmileyChris

  • attachment messageid.patch added.

Fallback for Python 2.3 (and caching of server name)

11/08/06 21:06:16 changed by SmileyChris

  • summary changed from random.getrandbits only available in python 2.4 to [patch] random.getrandbits only available in python 2.4.

socket.getfqdn() can be mightily slow in some cases so I've changed the code so it caches the hostname. If you didn't want to slow startup down any more, it could alternatively be lazily loaded.

11/09/06 08:44:26 changed by Gary Wilson <gary.wilson@gmail.com>

  • cc set to gary.wilson@gmail.com.

11/09/06 21:28:58 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [4058]) Fixed #3007 -- Fixed Python 2.4-ism from [4051] in django/core/mail.py. Also cached the result of socket.getfqdn(). Thanks for the patch, SmileyChris?


Add/Change #3007 ([patch] random.getrandbits only available in python 2.4)




Change Properties
Action