Opened 15 years ago

Closed 12 years ago

#12099 closed Bug (fixed)

admindocs generates an error on the tags page when template tags are included in an egg file

Reported by: Mark S. Choate <mark@…> Owned by: nobody
Component: contrib.admindocs Version: 1.1
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Alex Gaynor)

Here is the traceback -- the application appears to be looking on the filesystem for a file that doesn't exist.

Traceback:
File "/.../django/core/handlers/base.py" in get_response
  92.                 response = callback(request, *callback_args, **callback_kwargs)
File "/.../django/contrib/admin/views/decorators.py" in _checklogin
  33.             return view_func(request, *args, **kwargs)
File "/...o/django/contrib/admindocs/views.py" in template_tag_index
  54.     load_all_installed_template_libraries()
File "/.../django/contrib/admindocs/views.py" in load_all_installed_template_libraries
  313.         libraries = [os.path.splitext(p)[0] for p in os.listdir(e) if p.endswith('.py') and p[0].isalpha()]

Exception Type: OSError at /admin/doc/tags/

Change History (6)

comment:1 by Alex Gaynor, 15 years ago

Description: modified (diff)

Please use preview.

comment:2 by Russell Keith-Magee, 14 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Julien Phalip, 13 years ago

Severity: Normal
Type: Bug

comment:4 by Ramiro Morales, 13 years ago

Component: contrib.admincontrib.admindocs
Easy pickings: unset
UI/UX: unset

comment:5 by Aymeric Augustin, 12 years ago

I'm going to fix this by adopting a pattern similar to django.core.management.find_commands. Template tag libraries won't be found in eggs, but at least Django won't crash.

This is difficult to test. Here's one way to simulate the problem manually:

  • create a unused templatetags package in an app: mkdir django/contrib/auth/templatetags; touch mkdir django/contrib/auth/templatetags/__init__.py
  • run the development server and load the admin doc page to warm the templatetags libraries cache
  • make the templatetags package unreadable: chown -r django/contrib/auth/templatetags
  • reload the admin doc page

comment:6 by Aymeric Augustin, 12 years ago

Resolution: fixed
Status: newclosed

In [17401]:

(The changeset message doesn't reference this ticket)

Note: See TracTickets for help on using tickets.
Back to Top