#20167: import_by_path should show the original traceback on an ImportError
----------------------------+--------------------------
Reporter: grampajoe | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: master
Severity: Normal | Keywords: import utils
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
----------------------------+--------------------------
When django.utils.module_loading.import_by_path encounters an ImportError,
it hides the original traceback:
{{{
>>> import_by_path('utils_tests.test_module.bad_module.content')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/grampajoe/Projects/django/django/utils/module_loading.py",
line 28, in import_by_path
error_prefix, module_path, e))
django.core.exceptions.ImproperlyConfigured: Error importing module
utils_tests.test_module.bad_module: "No module named
a_package_name_that_does_not_exist"
}}}
That gives us the original exception message, but the traceback isn't
relevant or useful.
I've written a fix using six.reraise at
[https://github.com/grampajoe/django/tree/import-error-reraise].
--
Ticket URL: <https://code.djangoproject.com/ticket/20167>
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 post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.