[Django] #23032: Error with add_to_builtins

27 views
Skip to first unread message

Django

unread,
Jul 15, 2014, 10:29:56 AM7/15/14
to django-...@googlegroups.com
#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.

Django

unread,
Jul 15, 2014, 10:30:34 AM7/15/14
to django-...@googlegroups.com
#23032: Error with add_to_builtins
-------------------------------+--------------------------------------

Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by neihx@…):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/23032#comment:1>

Django

unread,
Jul 15, 2014, 10:35:29 AM7/15/14
to django-...@googlegroups.com
#23032: Error with add_to_builtins
-------------------------------+--------------------------------------
Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Ludovic Lardies <ludoviclrds@…>):

* version: 1.6 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/23032#comment:2>

Django

unread,
Jul 22, 2014, 6:48:49 PM7/22/14
to django-...@googlegroups.com
#23032: Error with add_to_builtins
-------------------------------+--------------------------------------
Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by timo):

I'm concerned that the fix may be hiding an actual problem with your
project. Can you check what the attempted imported module name is when
`None` is added to `builtins`?

--
Ticket URL: <https://code.djangoproject.com/ticket/23032#comment:3>

Django

unread,
Jul 23, 2014, 8:39:05 PM7/23/14
to django-...@googlegroups.com
#23032: Error with add_to_builtins
-------------------------------+--------------------------------------
Reporter: anonymous | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => needsinfo


--
Ticket URL: <https://code.djangoproject.com/ticket/23032#comment:4>

Reply all
Reply to author
Forward
0 new messages