#23032: Error with add_to_builtins
-------------------------------+--------------------
     Reporter:  anonymous      |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Uncategorized  |    Version:  1.6
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  1
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 I use Django with Tornado Web Server. It work like a charm when i start my
 server direcly with Python.

 I converted my project into a standalone exe program with py2exe. Now when
 i load a webpage i get the following error

 {{{
 ERROR:tornado.application:Uncaught exception, closing connection.
 Traceback (most recent call last):
   File "tornado\iostream.pyc", line 354, in wrapper
   File "tornado\stack_context.pyc", line 331, in wrapped
   File "tornado\stack_context.pyc", line 302, in wrapped
   File "tornado\httpserver.pyc", line 328, in _on_headers
   File "tornado\wsgi.pyc", line 251, in __call__
   File "django\core\handlers\wsgi.pyc", line 206, in __call__
   File "django\core\handlers\base.pyc", line 196, in get_response
   File "django\core\handlers\base.pyc", line 231, in
 handle_uncaught_exception
   File "django\views\debug.pyc", line 69, in technical_500_response
   File "django\views\debug.pyc", line 322, in get_traceback_html
   File "django\template\base.pyc", line 125, in __init__
   File "django\template\base.pyc", line 152, in compile_string
   File "django\template\debug.pyc", line 35, in __init__
   File "django\template\base.pyc", line 239, in __init__
   File "django\template\base.pyc", line 353, in add_library
 AttributeError: 'NoneType' object has no attribute 'tags'
 ERROR:tornado.application:Exception in callback <functools.partial object
 at 0x0
 3658DB0>
 Traceback (most recent call last):
   File "tornado\ioloop.pyc", line 477, in _run_callback
   File "tornado\stack_context.pyc", line 331, in wrapped
   File "tornado\stack_context.pyc", line 302, in wrapped
   File "tornado\iostream.pyc", line 354, in wrapper
   File "tornado\stack_context.pyc", line 331, in wrapped
   File "tornado\stack_context.pyc", line 302, in wrapped
   File "tornado\httpserver.pyc", line 328, in _on_headers
   File "tornado\wsgi.pyc", line 251, in __call__
   File "django\core\handlers\wsgi.pyc", line 206, in __call__
   File "django\core\handlers\base.pyc", line 196, in get_response
   File "django\core\handlers\base.pyc", line 231, in
 handle_uncaught_exception
   File "django\views\debug.pyc", line 69, in technical_500_response
   File "django\views\debug.pyc", line 322, in get_traceback_html
   File "django\template\base.pyc", line 125, in __init__
   File "django\template\base.pyc", line 152, in compile_string
   File "django\template\debug.pyc", line 35, in __init__
   File "django\template\base.pyc", line 239, in __init__
   File "django\template\base.pyc", line 353, in add_library
 AttributeError: 'NoneType' object has no attribute 'tags'
 }}}

 To fix that problem I add a condition in `add_to_builtins`. This
 add_to_builtins:
 https://github.com/django/django/blob/master/django/template/base.py#L1353

 My `add_to_builtins` :
 {{{
 def add_to_builtins(module):
     mod_imported = import_library(module)
     if mod_imported != None :
         builtins.append(mod_imported)
 }}}

 Don't know if I fix that problem by the right way but that work for me.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23032>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.1e96c7aa9f6855fd795407c309d8f703%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to