Opened 8 years ago

Closed 8 years ago

Last modified 5 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: UI/UX:

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 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Carl Meyer

Attachment: 9323_r9208.diff added

comment:1 Changed 8 years ago by Carl Meyer

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 Changed 8 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

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

comment:4 Changed 8 years ago by Malcolm Tredinnick

(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 Changed 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

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