Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#9323 closed (fixed)

INSTALLED_APPS * glob won't load apps with number in name

Reported by: carljm 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 carljm 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by carljm

comment:1 Changed 6 years ago by carljm

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 6 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 6 years ago by mtredinnick

(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 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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