#36864: Automatic shell imports cannot reliably handle submodules
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:  Jacob
                                     |  Walls
         Type:  Bug                  |                   Status:  assigned
    Component:  Core (Management     |                  Version:  5.2
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:  import_string,       |             Triage Stage:  Accepted
  submodule                          |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

 +1 to extending `import_string()` to handle modules reliably. Falling back
 to `importlib.import_module()` when `getattr()` fails feels like the
 correct fix. It makes `import_string()` consistent regardless of prior
 import state, and as Tim said werkzeug's  long-standing implementation of
 the same pattern demonstrates it is stable in practice.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36864#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019cb57e8bc6-ed8e40ad-bebc-4ae9-bff6-9f1804935c63-000000%40eu-central-1.amazonses.com.

Reply via email to