#21256 closed Bug (fixed)
Error in django.utils.datetime_safe.datetime.combine method
| Reported by: | Łukasz | Owned by: | nobody |
|---|---|---|---|
| Component: | Utilities | Version: | 1.5 |
| Severity: | Release blocker | 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
There seems to be an error in the combine() method of the django.utils.datetime_safe.datetime class. Current definition:
def combine(self, date, time):
return datetime(date.year, date.month, date.day, time.hour, time.minute, time.microsecond, time.tzinfo)
The time.second value is not passed to the datetime constructor. Moreover, this method should be a classmethod, like so:
@classmethod
def combine(cls, date, time):
return cls(date.year, date.month, date.day, time.hour, time.minute, time.second, time.microsecond, time.tzinfo)
Change History (5)
comment:1 by , 12 years ago
| Severity: | Normal → Release blocker |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
This bug has been corrupting data since #1443 was fixed, more than five years ago. It's interesting that it wasn't detected earlier.
(FWIW I don't really like
datetime_safe.)Since the fix is really trivial and it's a data corruption bug, I'm going to backport the fix back to 1.4.