#10048 closed (fixed)
Check for no timezone in dateformat.py
Reported by: | Claude Paroz | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The DateFormat class in source:django/trunk/django/utils/dateformat.py has a self.timezone attribute that can be None (self.timezone = getattr(dt, 'tzinfo', None)). However, it is not checked for None value when called in I(), T(), U() and Z() methods.
This can lead to AttributeError:
File "/usr/lib/python2.5/site-packages/django/utils/dateformat.py", line 195, in T name = self.timezone.tzname(self.data) AttributeError: 'NoneType' object has no attribute 'tzname'
Change History (4)
comment:1 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 16 years ago
Note:
See TracTickets
for help on using tickets.
(In [9919]) Fixed #10048 -- Handle non-existent timezone in dateformat functions.