#28911: Django dependency pytz does not recognize Msft time zone within Windows
Subsystem for Linux
----------------------------------+--------------------------------------
Reporter: El'endia Starman | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.11
Severity: Normal | Resolution:
Keywords: timezone | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Comment (by El'endia Starman):
Replying to [comment:1 Tim Graham]:
> I don't understand the reasoning behind your proposed patch. It seems
that will make Django silently ignore an invalid time zone and use UTC
instead. Can you clarify? Is your use case not solved with `TIME_ZONE =
'UTC'`?
This is what happens with `TIME_ZONE = 'UTC'`:
{{{
➜ IdeaGrapher git:(master) ✗ cat IdeaGrapher/settings.py | grep TIME_ZONE
TIME_ZONE = 'UTC'
➜ IdeaGrapher git:(master) ✗ workon django
(django)➜ IdeaGrapher git:(master) ✗ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/elendiastarman/.virtualenvs/django/lib/python3.4/site-
packages/django/core/management/__init__.py", line 364, in
execute_from_command_line
utility.execute()
File "/home/elendiastarman/.virtualenvs/django/lib/python3.4/site-
packages/django/core/management/__init__.py", line 308, in execute
settings.INSTALLED_APPS
File "/home/elendiastarman/.virtualenvs/django/lib/python3.4/site-
packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/home/elendiastarman/.virtualenvs/django/lib/python3.4/site-
packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/elendiastarman/.virtualenvs/django/lib/python3.4/site-
packages/django/conf/__init__.py", line 137, in __init__
raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
ValueError: Incorrect timezone setting: UTC
(django)➜ IdeaGrapher git:(master) ✗ ls /usr/share/zoneinfo
Msft
}}}
`Msft` is the only valid time zone when working in the Windows Subsystem
for Linux. Inconveniently, pytz does not recognize it. Hence, I just
defaulted the time zone that pytz sees to UTC.
--
Ticket URL: <https://code.djangoproject.com/ticket/28911#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/072.52a3610b6a77bd5722c4118797743143%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.