#10825: Template filter date 'U' raises an AttributeError under certain circumstances -----------------------------+---------------------------------------------- Reporter: mk | Owner: nobody Status: new | Milestone: Component: Template system | Version: SVN Keywords: template date | Stage: Unreviewed Has_patch: 0 | -----------------------------+---------------------------------------------- While fixing #10048 in [9919] a new bug has been introduced. Around line 200 in django/utils/dateformat.py:
{{{ def U(self): "Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)" off = self.timezone and self.timezone.utcoffset(self.data) or 0 return int(time.mktime(self.data.timetuple())) + off.seconds * 60 }}} If self.timezone and self.timezone.utfoffset(self.data) evaluates to False, Django tries to access off.seconds but off is 0 => An AttributeError (int has no attribute seconds) is raised. Unfortunately I do not know enough about the timezone handling to provide a test or even a fix. -- Ticket URL: <http://code.djangoproject.com/ticket/10825> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---