#23756: Fall DST change breaks timezone.py make_aware
---------------------------+------------------------------------
Reporter: mdineen | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------+------------------------------------
Comment (by mdineen):
Replying to [comment:2 aaugustin]:
> This is done on purpose according to the Zen of Python: "in the face of
ambiguity, refuse the temptation to guess."
>
> Celery's solution is to assume that naive datetimes are in UTC. We can't
adopt this solution for `make_aware` because it takes a `timezone`
argument which can have a value other than UTC.
>
> Always assuming the earliest date may work for your use case, but it may
be considered a silent data corruption bug for other use cases, so it
isn't an assumption we can enforce in the framework.
Okay, without specifying a solution, I'd like to highlight that the line
below causes problems every time in my code.
https://github.com/django/django/blob/master/django/utils/timezone.py#L361
Can be reproduced with any app using tz, admin, any date field and a date
in the affected range.
--
Ticket URL: <https://code.djangoproject.com/ticket/23756#comment:3>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.0079f8fcab69a3fe4e450e5d913bfa41%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.