#28014: "manage.py makemigrations --check" exits with 0 in case of exception
-------------------------------------+-------------------------------------
               Reporter:  Daniel     |          Owner:  nobody
  Hahler                             |
                   Type:  Bug        |         Status:  new
              Component:  Core       |        Version:  master
  (Management commands)              |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In case there is an exception from one of the migrations, it will print
 this,
 but exits with status code 0.


 {{{
 % manage.py makemigrations --check
 INFO:root:settings.ENVIRONMENT: dev
 Traceback (most recent call last):
   File "…/project/bin/manage.py", line 8, in <module>
     execute_from_command_line(sys.argv)
   File "……/src/django/django/core/management/__init__.py", line 367, in
 execute_from_command_line
     utility.execute()
   File "……/src/django/django/core/management/__init__.py", line 359, in
 execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "……/src/django/django/core/management/base.py", line 294, in
 run_from_argv
     self.execute(*args, **cmd_options)
   File "……/src/django/django/core/management/base.py", line 345, in
 execute
     output = self.handle(*args, **options)
   File "……/src/django/django/core/management/commands/makemigrations.py",
 line 95, in handle
     loader = MigrationLoader(None, ignore_no_migrations=True)
   File "……/src/django/django/db/migrations/loader.py", line 52, in
 __init__
     self.build_graph()
   File "……/src/django/django/db/migrations/loader.py", line 197, in
 build_graph
     self.load_disk()
   File "……/src/django/django/db/migrations/loader.py", line 108, in
 load_disk
     migration_module = import_module("%s.%s" % (module_name,
 migration_name))
   File "…/pyenv/3.5.2/lib/python3.5/importlib/__init__.py", line 126, in
 import_module
     return _bootstrap._gcd_import(name[level:], package, level)
   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
   File "<frozen importlib._bootstrap>", line 958, in
 _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
   File "<frozen importlib._bootstrap_external>", line 665, in exec_module
   File "<frozen importlib._bootstrap>", line 222, in
 _call_with_frames_removed
   File "…/app/migrations/0100_feedback.py", line 12, in <module>
     raise Exception()
 Exception
 }}}


 This might be more an issue of `manage.py` itself, which should exit non-
 zero
 in case of any exception?!

 {{{
 try:
     execute_from_command_line(sys.argv)
 except Exception as e:
     traceback.print_exc()
     sys.exit(3)
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28014>
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/050.e95373a886ff60022799b3c8891f2e23%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to