#17009: New version caused ValueError: Incorrect timezone setting: GMT-8
--------------------------------+--------------------------------------
     Reporter:  fangzhouxing@…  |                    Owner:  nobody
         Type:  Bug             |                   Status:  closed
    Component:  Uncategorized   |                  Version:  1.3
     Severity:  Normal          |               Resolution:  invalid
     Keywords:  timezone        |             Triage Stage:  Unreviewed
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+--------------------------------------
Changes (by aaugustin):

 * status:  new => closed
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0
 * resolution:   => invalid


Old description:

> I use Ubuntu 8.04. I have found the source code in /usr/lib/python2.5
> /site-packages/django/conf/__init__.py has changed since version 1.2.3
> and caused this problem. The following code is added by version 1.3.0:
>
>  zoneinfo_root = '/usr/share/zoneinfo'
>             if (os.path.exists(zoneinfo_root) and not
>                     os.path.exists(os.path.join(zoneinfo_root,
> *(self.TIME_ZONE.split('/'))))):
>                 raise ValueError("Incorrect timezone setting: %s" %
> self.TIME_ZONE)

New description:

 I use Ubuntu 8.04. I have found the source code in `/usr/lib/python2.5
 /site-packages/django/conf/__init__.py` has changed since version 1.2.3
 and caused this problem. The following code is added by version 1.3.0:

 {{{
  zoneinfo_root = '/usr/share/zoneinfo'
             if (os.path.exists(zoneinfo_root) and not
                     os.path.exists(os.path.join(zoneinfo_root,
 *(self.TIME_ZONE.split('/'))))):
                 raise ValueError("Incorrect timezone setting: %s" %
 self.TIME_ZONE)

 }}}

--

Comment:

 [https://docs.djangoproject.com/en/dev/ref/settings/#time-zone The docs]
 link to a [http://www.postgresql.org/docs/8.1/static/datetime-
 keywords.html#DATETIME-TIMEZONE-SET-TABLE list of valid time zone
 choices]. I think `TIME_ZONE = "Etc/GMT-8"` should do what you want.

 The change you mention is a bugfix for #3415 introduced at r13722. It
 reveals the problem, but the root cause is still the fact that your
 `TIME_ZONE` setting is invalid. It isn't a bug in 1.3; the bug really was
 in 1.2 who should have warned you already.

 Historically, Django hasn't sufficiently validated the value of
 `settings.TIME_ZONE`. It must be a timezone your system knows (ie. a file
 in /usr/share/zoneinfo) for `time.tzset()` to work properly. It must also
 be a timezone PostgreSQL knows if you're using the PostgreSQL backend.

 I hope this helps. Thanks for the report!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17009#comment:1>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to