Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#13464 closed (fixed)

django.utils.module_loading.has_submodule is incorrectly implemented

Reported by: Alex Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords:
Cc: brettcannon 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 4 years ago.
django-importer.2.diff (5.4 KB) - added by Alex 4 years ago.
Moar lazy

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by Alex

Changed 4 years ago by Alex

Moar lazy

comment:1 Changed 4 years ago by Alex

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by russellm

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

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

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

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.