#15525: Custom template tags loading breaks whenever templatetags is a python file -------------------------------------------+---------------------------- Reporter: the_drow | Owner: the_drow Status: assigned | Milestone: 1.4 Component: Template system | Version: 1.2 Resolution: | Keywords: templatetags Triage Stage: Accepted | Has patch: 1 Needs documentation: 0 | Needs tests: 1 Patch needs improvement: 1 | -------------------------------------------+---------------------------- Changes (by the_drow):
* status: new => assigned * owner: nobody => the_drow Comment: Recreated the traceback in order to add a more specific error: {{{ Environment: Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.2.5 Python Version: 2.6.6 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.flatpages', 'dojango', 'south', 'reversion', 'sitetree', 'tagging', 'paging', 'disqus', 'autoslug', 'django_generic_flatblocks', 'cms', 'blog', 'testtemplatetagserror'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'dojango.middleware.DojoCollector', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware') Traceback: File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.6/dist- packages/django/views/generic/simple.py" in direct_to_template 17. t = loader.get_template(template) File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in get_template 157. template, origin = find_template(template_name) File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in find_template 134. source, display_name = loader(name, dirs) File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in __call__ 42. return self.load_template(template_name, template_dirs) File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in load_template 48. template = get_template_from_string(source, origin, template_name) File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in get_template_from_string 168. return Template(source, origin, name) File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in __init__ 158. self.nodelist = compile_string(template_string, origin) File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in compile_string 186. return parser.parse() File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in parse 282. compiled_result = compile_func(self, token) File "/usr/local/lib/python2.6/dist- packages/django/template/loader_tags.py" in do_extends 195. nodelist = parser.parse() File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in parse 282. compiled_result = compile_func(self, token) File "/usr/local/lib/python2.6/dist- packages/django/template/loader_tags.py" in do_block 173. nodelist = parser.parse(('endblock', 'endblock %s' % block_name)) File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in parse 282. compiled_result = compile_func(self, token) File "/usr/local/lib/python2.6/dist- packages/django/template/defaulttags.py" in load 924. lib = get_library(taglib) File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in get_library 1040. lib = import_library(taglib_module) File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in import_library 992. if not module_has_submodule(app_module, taglib): File "/usr/local/lib/python2.6/dist- packages/django/utils/module_loading.py" in module_has_submodule 17. for entry in package.__path__: # No __path__, then not a package. Exception Type: AttributeError at / Exception Value: 'module' object has no attribute '__path__' }}} Why does it break on: {{{ nodelist = parser.parse(('endblock', 'endblock %s' % block_name)) }}} And where does the try block begins and ends? -- Ticket URL: <http://code.djangoproject.com/ticket/15525#comment:6> Django <http://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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.