Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#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)

9323_r9208.diff (2.7 KB ) - added by Carl Meyer 16 years ago.

Download all attachments as: .zip

Change History (6)

by Carl Meyer, 16 years ago

Attachment: 9323_r9208.diff added

comment:1 by Carl Meyer, 16 years ago

Has patch: set

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?

comment:2 by Jacob, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [9994]) Fixed #9323 -- Allow glob loading in INSTALLED_APPS to handle digits in names.
Patch from carljm.

comment:4 by Malcolm Tredinnick, 16 years ago

(In [9995]) [1.0.X] Fixed #9323 -- Allow glob loading in INSTALLED_APPS to handle digits in names.
Patch from carljm.

Backport of r9994 from trunk.

comment:5 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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