#23495: ImportError silenced
--------------------------+------------------------------------------------
     Reporter:            |      Owner:  nobody
  papaloizouc             |     Status:  new
         Type:            |    Version:  1.6
  Uncategorized           |   Keywords:  exceptions, import, conf, settings
    Component:            |  Has patch:  0
  Uncategorized           |      UI/UX:  0
     Severity:  Normal    |
 Triage Stage:            |
  Unreviewed              |
Easy pickings:  1         |
--------------------------+------------------------------------------------
 Hi sometimes i get import errors silenced by {{{django/conf/__init__.py}}}
 source code link
 
[https://github.com/django/django/blob/885ff6845e54511022677c1f28b84ddd4f2165dd/django/conf/__init__.py#L94]

 I comment out the {{{except ImportError as e:}}} in order to get a proper
 stacktrace on where my code crashed.

 So for example models.py imports from util.py that actually does not exist
 i get error {{{ImportError: Could not import settings
 'sharehoods.settings' (Is it on sys.path? Is there an import error in the
 settings file?): No module named util}}}. Because this is not clear what
 happened in the source code, i uncomment the exception catch in the source
 code and then i get the real stacktrace where the import error happened in
 my code so i know how to fix it. I'm not sure why the exception is
 silenced and re-raised but i personally always have it commented out on my
 pc so i thought i should mention.

--
Ticket URL: <https://code.djangoproject.com/ticket/23495>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/054.1e955d1e38c1fec08f275863aa2077ec%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to