#12593: "manage.py loaddata" exits with system exist status 0 when there are 
errors
------------------------------------+---------------------------------------
          Reporter:  bruce_s        |         Owner:  nobody
            Status:  new            |     Milestone:        
         Component:  Uncategorized  |       Version:  1.1   
        Resolution:                 |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  0     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Changes (by bruce_s):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Patch to fix with sys.exit(1):

 --- loaddata.py 2010-01-12 10:54:47.000000000 -0800
 +++ /usr/lib64/python2.6/site-
 packages/django/core/management/commands/loaddata.py      2010-01-12
 10:54:17.000000000 -0800
 @@ -105,7 +105,7 @@ class Command(BaseCommand):
                          (fixture_name, format)))
                  transaction.rollback()
                  transaction.leave_transaction_management()
 -                sys.exit(1)
 +                return

              if os.path.isabs(fixture_name):
                  fixture_dirs = [fixture_name]
 @@ -138,7 +138,7 @@ class Command(BaseCommand):
                                      (fixture_name,
 humanize(fixture_dir)))
                                  transaction.rollback()
 transaction.leave_transaction_management()
 -                                sys.exit(1)
 +                                return
                              else:
                                  fixture_count += 1
                                  objects_in_fixture = 0
 @@ -167,7 +167,7 @@ class Command(BaseCommand):
                                              self.style.ERROR("Problem
 installing fixture '%s': %s\n" %
                                                   (full_path,
 ''.join(traceback.format_exception(sys.exc_type,
                                                       sys.exc_value,
 sys.exc_traceback)))))
 -                                    sys.exit(1)
 +                                    return
                                  fixture.close()

                                  # If the fixture we loaded contains 0
 objects, assume that an
 @@ -178,7 +178,7 @@ class Command(BaseCommand):
                                              (fixture_name)))
                                      transaction.rollback()
 transaction.leave_transaction_management()
 -                                    sys.exit(1)
 +                                    return

                          except Exception, e:
                              if verbosity > 1:

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12593#comment:1>
Django <http://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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to