[Django] #20926: postgresql 'infinity' raises 'OverflowError: date value out of range' if TZ is east of UTC

109 views
Skip to first unread message

Django

unread,
Aug 15, 2013, 4:52:21 PM8/15/13
to django-...@googlegroups.com
#20926: postgresql 'infinity' raises 'OverflowError: date value out of range' if TZ
is east of UTC
-------------------------------+--------------------
Reporter: tim@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.5
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
When a datetime field is set to 'infinity' by an external application,
django will throw an 'OverflowError: date value out of range' when the
corresponding model object is modified within django the next time. This
only occurs, however, if the timezone which is set is not UTC (in my
Example 'Europe/Berlin').

The problem is, that django translates infinity to the maximum allowed
timestamp of 9999-12-31 23:59:59 but timezone unaware. When Django tries
to make the timestamp timezone aware, it uses the local timezone as
default, which makes the timestamp in UTC larger than the maximum allowed
timestamp, throwing the Exception.
I would guess, that this only applies for Timezones east of UTC.

--
Ticket URL: <https://code.djangoproject.com/ticket/20926>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 22, 2013, 2:58:06 AM8/22/13
to django-...@googlegroups.com
#20926: postgresql 'infinity' raises 'OverflowError: date value out of range' if TZ
is east of UTC
-------------------------------+------------------------------------

Reporter: tim@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.5
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
-------------------------------+------------------------------------
Changes (by apollo13):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/20926#comment:1>

Django

unread,
Aug 22, 2013, 8:02:48 AM8/22/13
to django-...@googlegroups.com
#20926: postgresql 'infinity' raises 'OverflowError: date value out of range' if TZ
is east of UTC
-------------------------------------+-------------------------------------
Reporter: tim@… | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.5
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by claudep):

* type: Uncategorized => Bug
* component: Uncategorized => Database layer (models, ORM)


--
Ticket URL: <https://code.djangoproject.com/ticket/20926#comment:2>

Django

unread,
Sep 7, 2013, 10:46:24 AM9/7/13
to django-...@googlegroups.com
#20926: postgresql 'infinity' raises 'OverflowError: date value out of range' if TZ
is east of UTC
-------------------------------------+-------------------------------------
Reporter: tim@… | Owner: mburst
Type: Bug | Status: assigned

Component: Database layer | Version: 1.5
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by mburst):

* status: new => assigned
* owner: nobody => mburst


--
Ticket URL: <https://code.djangoproject.com/ticket/20926#comment:3>

Django

unread,
Sep 7, 2013, 12:08:56 PM9/7/13
to django-...@googlegroups.com
#20926: postgresql 'infinity' raises 'OverflowError: date value out of range' if TZ
is east of UTC
-------------------------------------+-------------------------------------
Reporter: tim@… | Owner: mburst
Type: Bug | Status: closed

Component: Database layer | Version: 1.5
(models, ORM) | Resolution: needsinfo

Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* status: assigned => closed
* resolution: => needsinfo


Comment:

Please install pytz (as recommended by the docs) and check if the bug
still happens.

If it does, please reopen the ticket and provide a complete traceback.

--
Ticket URL: <https://code.djangoproject.com/ticket/20926#comment:4>

Reply all
Reply to author
Forward
0 new messages