2009/6/27 Karen Tracey <kmtra...@gmail.com>: <snip> > FYI, there's a "switch to copy and paste" link which makes the debug > information less verbose and gives you something you can paste into an > email. >
Cheers, will use in future. > > What about Python level? You've got a mixture of what appears to be Python > 2.5, 2.6.2, and who knows what from netbeans-6.5, as reported version and in > your Python path: > <snip> > The exception is "Attribute Error" on _strptime_time, raised on an innocuous > line of code: > > return datetime.date(*time.strptime(value, format)[:3]) > > that's line 308 of > /var/lib/python-support/python2.5/django/forms/fields.py. With a valid > Python install/path, there's no way that line of code should raise that > AttributeError, so I suspect your Python install is broken as a result of > (partially?) installing 2.6.2 on top of 2.5 yet keeping 2.5 in the path > ahead of 2.6.2, or something. > > Try importing "time" and calling time.strptime in a Python shell -- the > values Django was trying to use here are u'2009-06-27' for value and > '%Y-%m-%d' for format (though I'd guess it doesn't really matter what values > exactly are used). I suspect you'll get the same exception in the shell. > Until you fix your base Python to work properly for calls like that Django > is going to have trouble. > > Karen > Running time.strptime in a shell (Python 2.6.2) give me a struct_time object (as I would expect), so it looks like it is as you say - the mixmatch of 2.5 and 2.6 that causes the error. Furthermore, if I run runserver through a shell, the problem goes away. I therefore conclude that it is the IDE I am using (netbeans) that is creating a custom path, and doing it badly! Thanks for the pointers, I now know what I need to fix, and how to get around it in the meantime. Steve Garton http://www.sheepeatingtaz.co.uk --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---