#879 closed defect (fixed)
Error when loading malformed MIDDLEWARE_CLASSES path
| Reported by: | anonymous | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | Core (Other) | Version: | |
| Severity: | normal | Keywords: | middleware core |
| Cc: | nslater@… | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
If the settings file defines the middleware classes like this:
MIDDLEWARE_CLASSES = ('foo',)
The following code found in /core/handlers/base.py when calling load_middleware():
for middleware_path in settings.MIDDLEWARE_CLASSES:
try:
dot = middleware_path.rindex('.')
mw_module, mw_classname = middleware_path[:dot], middleware_path[dot+1:]
except ValueError:
raise exceptions.ImproperlyConfigured, '"%s" does not look like a middleware module' % (middleware_path)
will throw a ValueError when attempting the rindex('.') method call.
Attachments (1)
Change History (5)
by , 20 years ago
| Attachment: | base.py.diff added |
|---|
comment:2 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 20 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
No problem! The grammar of the error message in [1355] has been mangled however. :)
Note:
See TracTickets
for help on using tickets.
Patch