Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28124 closed Bug (invalid)

Timezone-related overflows in utils

Reported by: Zac Hatfield Dodds Owned by: nobody
Component: Utilities Version: 1.11
Severity: Normal Keywords: timezone, overflow, datetime
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Many methods in django/utils/timezone.py will raise OverflowError if given an aware datetime and a timezone in which it is unrepresentable.

This is literally an edge case, and simply propagating the exception may be the right thing to do. Either way, reporting upstream means https://github.com/HypothesisWorks/hypothesis-python/issues/322 can be closed.

Change History (2)

comment:1 by Tim Graham, 7 years ago

Resolution: invalid
Status: newclosed

I don't see what else Django could do in this case.

comment:2 by Aymeric Augustin, 7 years ago

FWIW it's a design decision of mine when I implemented time zone support in 1.4, not an oversight.

Back then, Django also contained some code implementing datetime arithmetic beyond 1970 / 2038 for humanize filters, but that code wasn't consistent with the rest of Django. I'm not sure what it became; perhaps it's still there.

In any case I'm not eager to implement time zone arithmetic besides what Python and pytz support. It doesn't feel like a generalist web framework like Django should do that. It's more of a job for a specialized library.

For these reasons I agree with closing this ticket as wontfix.

Note: See TracTickets for help on using tickets.
Back to Top