Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'NoneType' object has no attribute 'upper' #21

Closed
saurabhchandrapatel opened this issue Dec 7, 2018 · 1 comment
Closed

'NoneType' object has no attribute 'upper' #21

saurabhchandrapatel opened this issue Dec 7, 2018 · 1 comment

Comments

@saurabhchandrapatel
Copy link

Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/buildenv2/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in call
return self.application(environ, start_response)
File "/buildenv2/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 157, in call
response = self.get_response(request)
File "/buildenv2/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response
response = self._middleware_chain(request)
File "/buildenv2/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 43, in inner
response = response_for_exception(request, exc)
File "/buildenv2/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 93, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/buildenv2/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 139, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/buildenv2/local/lib/python2.7/site-packages/django/views/debug.py", line 84, in technical_500_response
html = reporter.get_traceback_html()
File "/buildenv2/local/lib/python2.7/site-packages/django/views/debug.py", line 328, in get_traceback_html
return t.render(c)
File "/buildenv2/local/lib/python2.7/site-packages/django/template/base.py", line 207, in render
return self._render(context)
File "/buildenv2/local/lib/python2.7/site-packages/django/template/base.py", line 199, in _render
return self.nodelist.render(context)
File "/buildenv2/local/lib/python2.7/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/buildenv2/local/lib/python2.7/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/buildenv2/local/lib/python2.7/site-packages/django/template/base.py", line 1040, in render
output = self.filter_expression.resolve(context)
File "/buildenv2/local/lib/python2.7/site-packages/django/template/base.py", line 732, in resolve
obj = template_localtime(obj, context.use_tz)
File "/buildenv2/local/lib/python2.7/site-packages/django/utils/timezone.py", line 195, in template_localtime
return localtime(value) if should_convert else value
File "/buildenv2/local/lib/python2.7/site-packages/django/utils/timezone.py", line 213, in localtime
timezone = get_current_timezone()
File "/buildenv2/local/lib/python2.7/site-packages/django/utils/timezone.py", line 97, in get_current_timezone
return getattr(_active, "value", get_default_timezone())
File "/buildenv2/local/lib/python2.7/site-packages/django/utils/lru_cache.py", line 124, in wrapper
result = user_function(*args, **kwds)
File "/buildenv2/local/lib/python2.7/site-packages/django/utils/timezone.py", line 79, in get_default_timezone
return pytz.timezone(settings.TIME_ZONE)
File "/buildenv2/local/lib/python2.7/site-packages/pytz/init.py", line 160, in timezone
if zone.upper() == 'UTC':
AttributeError: 'NoneType' object has no attribute 'upper'
2018-12-07 12:58:11,921 ERROR django.server "GET / HTTP/1.1" 500 59

@stub42
Copy link
Owner

stub42 commented Jan 10, 2019

An invalid timezone name was passed into pytz.timezone. I've updated the code to raise an UnknownTimeZoneError in this case, as documented. This fix will be in the next pytz release (2019*)

@stub42 stub42 closed this as completed Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants