#25555: runserver swallows exceptions
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Management | Version: 1.8
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by akaariai):
Yes, that one fixes the issue. Instead of getting apps not ready
exception, I can see the original exception on command line. If I fix the
error in the settings, the project is correctly reloaded.
If I start the runserver with an exception caused by a mistake in
models.py of some installed app, then I get the following exception:
{{{
(tehku2_env)securejava@debian:~/projects/tehku2$ python manage.py
runserver
Traceback (most recent call last):
File "/home/securejava/projects/tehku2_env/lib/python3.4/site-
packages/django/core/management/__init__.py", line 317, in execute
autoreload.check_errors(django.setup)()
File "/home/securejava/projects/tehku2_env/lib/python3.4/site-
packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/home/securejava/projects/tehku2_env/lib/python3.4/site-
packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/securejava/projects/tehku2_env/lib/python3.4/site-
packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/home/securejava/projects/tehku2_env/lib/python3.4/site-
packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File
"/home/securejava/projects/tehku2_env/lib/python3.4/importlib/__init__.py",
line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in
_call_with_frames_removed
File "/home/securejava/projects/tehku2/tehku/models.py", line 114, in
<module>
raise Exception("hara")
Exception: hara
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 9, in <module>
execute_from_command_line(sys.argv)
File "/home/securejava/projects/tehku2_env/lib/python3.4/site-
packages/django/core/management/__init__.py", line 351, in
execute_from_command_line
utility.execute()
File "/home/securejava/projects/tehku2_env/lib/python3.4/site-
packages/django/core/management/__init__.py", line 321, in execute
apps.populate([])
File "/home/securejava/projects/tehku2_env/lib/python3.4/site-
packages/django/apps/registry.py", line 78, in populate
raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant
}}}
I guess we want to avoid that.
--
Ticket URL: <https://code.djangoproject.com/ticket/25555#comment:3>
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.c531f944486ce2754bdb7c69e5657015%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.