Opened 10 years ago

Closed 10 years ago

#23670 closed Bug (fixed)

autodiscover_modules prematurely breaks

Reported by: Jernej Kos Owned by: Markus Holtermann
Component: Utilities Version: 1.7
Severity: Normal Keywords:
Cc: mmitar@…, info+coding@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In case one specifies multiple module arguments to module_loading.autodiscover_modules and an application only has some of the modules, the discovery will prematurely break and not load the modules that exist.

For a simple example, assume there is an application foo with the following structure:

foo/__init__.py
foo/module_b.py

Then, calling module_loading.autodiscover_modules('module_a', 'module_b') will not import module_b because the error handling logic will abort on import failure of module_a. Error handling needs to be moved inside the for loop over args for this to work correctly.

Change History (5)

comment:1 by Mitar, 10 years ago

Cc: mmitar@… added

comment:2 by Tim Graham, 10 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Markus Holtermann, 10 years ago

Cc: info+coding@… added
Owner: changed from nobody to Markus Holtermann
Status: newassigned

comment:4 by Markus Holtermann, 10 years ago

Has patch: set

comment:5 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 98da408964b229ee0b35bb8c4500820e3606aeab:

Fixed #23670 -- Prevented partial import state during module autodiscovery

Thanks kostko for the report.

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