#13311: Template Tag modules that raise an ImportError are difficult to debug ---------------------------------+------------------------------------------ Reporter: amccurdy | Owner: nobody Status: new | Milestone: Component: Template system | Version: 1.2-beta Keywords: templatetag library | Stage: Unreviewed Has_patch: 0 | ---------------------------------+------------------------------------------ I have several template tag libraries that I register using the add_to_builtins function. While upgrading to Django 1.2, I found that one of these template tag libraries was raising an ImportError. The ImportError was hidden from me however, because django.template.import_library catches ImportError and simply returns None. The None value still gets added to the django.template.builtins module-level variable, which eventually ends up making it's way to the Parser class's add_library function. Parser.add_library references the .tags attribute without checking for None, raising an AttributeError. There's was no indication of which template tag library caused the error, making this a pain to track down.
I would suggest that django.template.import_library not mask the ImportError. If this breaks backwards compatibility, then at least raise the ImportError from django.template.add_to_builtins. -- Ticket URL: <http://code.djangoproject.com/ticket/13311> 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.
