Author: adrian
Date: 2007-09-19 21:19:48 -0500 (Wed, 19 Sep 2007)
New Revision: 6386
Modified:
django/trunk/django/contrib/sessions/backends/base.py
Log:
Fixed #5548 -- Reintroduced Jython workaround for os.getpid(), which was lost
in [6270]. Thanks, leosoto
Modified: django/trunk/django/contrib/sessions/backends/base.py
===================================================================
--- django/trunk/django/contrib/sessions/backends/base.py 2007-09-20
02:02:54 UTC (rev 6385)
+++ django/trunk/django/contrib/sessions/backends/base.py 2007-09-20
02:19:48 UTC (rev 6386)
@@ -82,9 +82,14 @@
"Returns session key that isn't being used."
# The random module is seeded when this Apache child is created.
# Use settings.SECRET_KEY as added salt.
+ try:
+ pid = os.getpid()
+ except AttributeError:
+ # No getpid() in Jython, for example
+ pid = 1
while 1:
- session_key = md5.new("%s%s%s%s" % (random.randint(0, sys.maxint -
1),
- os.getpid(), time.time(),
settings.SECRET_KEY)).hexdigest()
+ session_key = md5.new("%s%s%s%s" % (random.randint(0, sys.maxint -
1),
+ pid, time.time(),
settings.SECRET_KEY)).hexdigest()
if not self.exists(session_key):
break
return session_key
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---