Skip to content

Daylight savings bug #1

@NickSto

Description

@NickSto
1520733615 INFO traffic.lib line  52 | Success getting IpInfo for [REDACTED]
1520733615 ERROR django.request line 132 | Internal Server Error: /traffic
Traceback (most recent call last):
  File "/var/www/nstoler.com/.venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = get_response(request)
  File "/var/www/nstoler.com/.venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/var/www/nstoler.com/.venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "./traffic/views.py", line 112, in monitor
    'timezone': set_timezone(request),  # Set and retrieve timezone.
  File "./traffic/ipinfo.py", line 179, in set_timezone
    tz = get_tz_abbrv(ipinfo[0].timezone)
  File "./traffic/ipinfo.py", line 212, in get_tz_abbrv
    return tz.tzname(datetime.now())
  File "/var/www/nstoler.com/.venv/lib/python3.5/site-packages/pytz/tzinfo.py", line 485, in tzname
    dt = self.localize(dt, is_dst)
  File "/var/www/nstoler.com/.venv/lib/python3.5/site-packages/pytz/tzinfo.py", line 327, in localize
    raise NonExistentTimeError(dt)
pytz.exceptions.NonExistentTimeError: 2018-03-11 02:00:15.682729

Happened on the afternoon before daylight savings in March (at 18:00:15 PST on March 10, 2018 (1520733615)).
Apparently it's trying to compute some time in the nonexistent hour between 2AM and 3AM?
The IP address is my Sunnyvale Comcast one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions