#9323 closed (fixed)
INSTALLED_APPS * glob won't load apps with number in name
| Reported by: | Carl Meyer | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Other) | Version: | 1.0 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The resolution of the "foo.*" glob in INSTALLED_APPS checks isalpha() on the name of each subdirectory before trying to import it. This is stricter than it should be, since Python package names may contain numbers anywhere except at the beginning. This leads to apps with numbers in the package name mysteriously being left out of INSTALLED_APPS.
The solution is to instead check d.isalnum() and d[0].isalpha() , which more closely matches the requirements for Python package names. Patch (with test) attached.
Attachments (1)
Change History (6)
by , 17 years ago
| Attachment: | 9323_r9208.diff added |
|---|
comment:1 by , 17 years ago
| Has patch: | set |
|---|
comment:2 by , 17 years ago
| milestone: | → 1.1 |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:3 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:4 by , 17 years ago
Note:
See TracTickets
for help on using tickets.
This patch has a test, fixes the problem, and applies cleanly to 1.0.x and trunk - anything else needed for 1.0.1 inclusion?