Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#13464 closed (fixed)

django.utils.module_loading.has_submodule is incorrectly implemented

Reported by: Alex Gaynor Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords:
Cc: Brett C. Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The main problem is we assume a loader has find_module method, which is only true if the loader and finder are a single class, which is in no way guaranteed. Brett Cannon has suggested an alternate implementation, which basically needs to re-implement the Python import machinery: http://paste.pocoo.org/show/209115/ (I'll turn it into a proper patch soonish)

Attachments (2)

django-importer.diff (5.9 KB) - added by Alex Gaynor 7 years ago.
django-importer.2.diff (5.4 KB) - added by Alex Gaynor 7 years ago.
Moar lazy

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Alex Gaynor

Attachment: django-importer.diff added

Changed 7 years ago by Alex Gaynor

Attachment: django-importer.2.diff added

Moar lazy

comment:1 Changed 7 years ago by Alex Gaynor

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [13082]) Fixed #13464 -- Reworked module_has_submodule to break the requirement for loader and finder to be the same class. Thanks to Alex Gaynor for the report and patch, and Brett Cannon for suggesting the approach.

comment:3 Changed 7 years ago by Russell Keith-Magee

(In [13085]) [1.1.X] Fixed #13464 -- Reworked module_has_submodule to break the requirement for loader and finder to be the same class. Thanks to Alex Gaynor for the report and patch, and Brett Cannon for suggesting the approach.

Backport of r13082 from trunk.

comment:4 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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