List Info

Thread: Python 2.3 deployment




Python 2.3 deployment
country flaguser name
Spain
2007-10-19 05:56:55
Hey guys!

I have no choice but deploy to this server, running CentOS
4.4, with no
option to upgrade python beyond 2.3, and I'm getting this:

Mod_python error: "PythonHandler
django.core.handlers.modpython"

Traceback (most recent call last):

  File
"/usr/lib/python2.3/site-packages/mod_python/apache.py&
quot;, line 299, in HandlerDispatch
    result = object(req)

  File
"/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 178, in handler
    return ModPythonHandler()(req)

  File
"/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 155, in __call__
    response = middleware_method(request, response)

  File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/middleware.py", line 95, in process_response
    obj = Session.objects.get_new_session_object()

  File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line 37, in get_new_session_object
    obj, created =
self.get_or_create(session_key=self.get_new_session_key(),

  File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line 19, in get_new_session_key
    session_key = md5.new("%s%s%s%s" %
(random.randint(0, sys.maxint - 1), os.getpid(),
time.time(), settings.SECRET_KEY)).hexdigest()

AttributeError: 'module' object has no attribute 'randint'


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Python 2.3 deployment
country flaguser name
Australia
2007-10-19 06:12:23
On Fri, 2007-10-19 at 11:56 +0100, Chris Hoeppner wrote:
> Hey guys!
> 
> I have no choice but deploy to this server, running
CentOS 4.4, with no
> option to upgrade python beyond 2.3, and I'm getting
this:
> 
> Mod_python error: "PythonHandler
django.core.handlers.modpython"
> 
> Traceback (most recent call last):
> 
>   File
"/usr/lib/python2.3/site-packages/mod_python/apache.py&
quot;, line 299, in HandlerDispatch
>     result = object(req)
> 
>   File
"/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 178, in handler
>     return ModPythonHandler()(req)
> 
>   File
"/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 155, in __call__
>     response = middleware_method(request, response)
> 
>   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/middleware.py", line 95, in process_response
>     obj = Session.objects.get_new_session_object()
> 
>   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line 37, in get_new_session_object
>     obj, created =
self.get_or_create(session_key=self.get_new_session_key(),
> 
>   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line 19, in get_new_session_key
>     session_key = md5.new("%s%s%s%s" %
(random.randint(0, sys.maxint - 1), os.getpid(),
time.time(), settings.SECRET_KEY)).hexdigest()
> 
> AttributeError: 'module' object has no attribute
'randint'

Something's a bit broken with your setup, then. Certainly
random.randint() existedin Python 2.3 (I just tested it).

Do a quick test to confirm that it really is missing in a
shell:

        Python 2.3.5 (#1, Mar 11 2007, 08:55:14) 
        [GCC 4.1.1 20070105 (Red Hat 4.1.1-51)] on linux2
        Type "help", "copyright",
"credits" or "license" for more
        information.
        >>> import random
        >>> random.randint
        <bound method Random.randint of <random.Random
object at
        0x672110>>

If that fails, your python installation is very
non-standard. You could
also try looking at the results of "rpm -qV
python" to check that there
hasn't been any inadvertent (or deliberate) changes to the
installed
rpm.

Note sure what to suggest here. The problem looks to be in
your
installation. Start asking serious questions of the sys
admin.

Regards,
Malcolm
        


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Python 2.3 deployment
country flaguser name
Spain
2007-10-19 07:03:03
Thanks, Malcolm!

For some reason, updating django to trunk solved it. My
system admins
told me kindly that it's not their problem. Very nice
indeed.


El vie, 19-10-2007 a las 21:12 +1000, Malcolm Tredinnick
escribi�:
> On Fri, 2007-10-19 at 11:56 +0100, Chris Hoeppner
wrote:
> > Hey guys!
> > 
> > I have no choice but deploy to this server,
running CentOS 4.4, with no
> > option to upgrade python beyond 2.3, and I'm
getting this:
> > 
> > Mod_python error: "PythonHandler
django.core.handlers.modpython"
> > 
> > Traceback (most recent call last):
> > 
> >   File
"/usr/lib/python2.3/site-packages/mod_python/apache.py&
quot;, line 299, in HandlerDispatch
> >     result = object(req)
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 178, in handler
> >     return ModPythonHandler()(req)
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 155, in __call__
> >     response = middleware_method(request,
response)
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/middleware.py", line 95, in process_response
> >     obj =
Session.objects.get_new_session_object()
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line 37, in get_new_session_object
> >     obj, created =
self.get_or_create(session_key=self.get_new_session_key(),
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line 19, in get_new_session_key
> >     session_key = md5.new("%s%s%s%s" %
(random.randint(0, sys.maxint - 1), os.getpid(),
time.time(), settings.SECRET_KEY)).hexdigest()
> > 
> > AttributeError: 'module' object has no attribute
'randint'
> 
> Something's a bit broken with your setup, then.
Certainly
> random.randint() existedin Python 2.3 (I just tested
it).
> 
> Do a quick test to confirm that it really is missing in
a shell:
> 
>         Python 2.3.5 (#1, Mar 11 2007, 08:55:14) 
>         [GCC 4.1.1 20070105 (Red Hat 4.1.1-51)] on
linux2
>         Type "help", "copyright",
"credits" or "license" for more
>         information.
>         >>> import random
>         >>> random.randint
>         <bound method Random.randint of
<random.Random object at
>         0x672110>>
> 
> If that fails, your python installation is very
non-standard. You could
> also try looking at the results of "rpm -qV
python" to check that there
> hasn't been any inadvertent (or deliberate) changes to
the installed
> rpm.
> 
> Note sure what to suggest here. The problem looks to be
in your
> installation. Start asking serious questions of the sys
admin.
> 
> Regards,
> Malcolm
>         
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Python 2.3 deployment
country flaguser name
Spain
2007-10-19 07:29:57
Huh I lied. The django update only forced me to call that
view with
POST, and now that I'm doing, it's throwing the same
traceback. I'm not
sure what this might be. I'll check again with the system
admins.


El vie, 19-10-2007 a las 21:12 +1000, Malcolm Tredinnick
escribi�:
> On Fri, 2007-10-19 at 11:56 +0100, Chris Hoeppner
wrote:
> > Hey guys!
> > 
> > I have no choice but deploy to this server,
running CentOS 4.4, with no
> > option to upgrade python beyond 2.3, and I'm
getting this:
> > 
> > Mod_python error: "PythonHandler
django.core.handlers.modpython"
> > 
> > Traceback (most recent call last):
> > 
> >   File
"/usr/lib/python2.3/site-packages/mod_python/apache.py&
quot;, line 299, in HandlerDispatch
> >     result = object(req)
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 178, in handler
> >     return ModPythonHandler()(req)
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 155, in __call__
> >     response = middleware_method(request,
response)
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/middleware.py", line 95, in process_response
> >     obj =
Session.objects.get_new_session_object()
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line 37, in get_new_session_object
> >     obj, created =
self.get_or_create(session_key=self.get_new_session_key(),
> > 
> >   File
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line 19, in get_new_session_key
> >     session_key = md5.new("%s%s%s%s" %
(random.randint(0, sys.maxint - 1), os.getpid(),
time.time(), settings.SECRET_KEY)).hexdigest()
> > 
> > AttributeError: 'module' object has no attribute
'randint'
> 
> Something's a bit broken with your setup, then.
Certainly
> random.randint() existedin Python 2.3 (I just tested
it).
> 
> Do a quick test to confirm that it really is missing in
a shell:
> 
>         Python 2.3.5 (#1, Mar 11 2007, 08:55:14) 
>         [GCC 4.1.1 20070105 (Red Hat 4.1.1-51)] on
linux2
>         Type "help", "copyright",
"credits" or "license" for more
>         information.
>         >>> import random
>         >>> random.randint
>         <bound method Random.randint of
<random.Random object at
>         0x672110>>
> 
> If that fails, your python installation is very
non-standard. You could
> also try looking at the results of "rpm -qV
python" to check that there
> hasn't been any inadvertent (or deliberate) changes to
the installed
> rpm.
> 
> Note sure what to suggest here. The problem looks to be
in your
> installation. Start asking serious questions of the sys
admin.
> 
> Regards,
> Malcolm
>         
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Python 2.3 deployment
country flaguser name
Australia
2007-10-19 07:34:24
On Fri, 2007-10-19 at 13:29 +0100, Chris Hoeppner wrote:
> Huh I lied. The django update only forced me to call
that view with
> POST, and now that I'm doing, it's throwing the same
traceback. I'm not
> sure what this might be. I'll check again with the
system admins.

When you tested at the interactive prompt -- which doesn't
involve
Django at all, did your random module contain a randint
function? That
would be the first thing to establish.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Python 2.3 deployment
user name
2007-10-19 08:12:58
>   File
>
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line
> 19, in get_new_session_key session_key =
md5.new("%s%s%s%s" %
> (random.randint(0, sys.maxint - 1), os.getpid(),
time.time(),
> settings.SECRET_KEY)).hexdigest()
>
> AttributeError: 'module' object has no attribute
'randint'

You can test what random module you are using:

insert a line above: assert False, random.__file__

You can test the random module:

python /usr/lib64/python2.4/random.py
2000 times random
0.003 sec, avg 0.497669, stddev 0.288045, min 0.00160483,
max 0.99949
2000 times normalvariate
....

HTH,
 Thomas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Python 2.3 deployment
country flaguser name
Spain
2007-10-19 10:51:42
Hi guys!

Thanks for those responses. So, the random.randint function
does exist:
# python
Python 2.3.5 (#1, Aug 25 2005, 09:17:44) 
[GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2
Type "help", "copyright",
"credits" or "license" for more
information.
>>> import random
>>> random.randint
<bound method Random.randint of <random.Random object
at 0x80a6c6c>>

And here's whar Thomas suggests:
AssertionError at /
/usr/lib/python2.3/random.pyc



El vie, 19-10-2007 a las 15:12 +0200, Thomas Guettler
escribi�:
> >   File
> >
"/usr/lib/python2.3/site-packages/django/contrib/sessio
ns/models.py", line
> > 19, in get_new_session_key session_key =
md5.new("%s%s%s%s" %
> > (random.randint(0, sys.maxint - 1), os.getpid(),
time.time(),
> > settings.SECRET_KEY)).hexdigest()
> >
> > AttributeError: 'module' object has no attribute
'randint'
> 
> You can test what random module you are using:
> 
> insert a line above: assert False, random.__file__
> 
> You can test the random module:
> 
> python /usr/lib64/python2.4/random.py
> 2000 times random
> 0.003 sec, avg 0.497669, stddev 0.288045, min
0.00160483, max 0.99949
> 2000 times normalvariate
> ....
> 
> HTH,
>  Thomas
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )