From 8d6fcfcd40d4130128e7ade1d3e43b0e63686045 Mon Sep 17 00:00:00 2001
From: Bastian Kleineidam <calvin@debian.org>
Date: Mon, 28 Jan 2008 08:40:59 +0100
Subject: Improved fixture error reporting

Print a complete traceback on fixture data error, and do not
hide SystemExit and KeyboardInterrupt errors.

Signed-off-by: Bastian Kleineidam <calvin@debian.org>

diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index d47e65f..74b27ab 100644
--- a/django/core/management/commands/loaddata.py
+++ b/django/core/management/commands/loaddata.py
@@ -102,7 +102,10 @@ class Command(BaseCommand):
                                     models.add(obj.object.__class__)
                                     obj.save()
                                 label_found = True
-                            except Exception, e:
+                            except (SystemExit, KeyboardInterrupt):
+                                raise
+                            except Exception:
+                                import traceback
                                 fixture.close()
                                 transaction.rollback()
                                 transaction.leave_transaction_management()
@@ -110,7 +113,7 @@ class Command(BaseCommand):
                                     raise
                                 sys.stderr.write(
                                     self.style.ERROR("Problem installing fixture '%s': %s\n" %
-                                         (full_path, str(e))))
+                                         (full_path, traceback.format_exc())))
                                 return
                             fixture.close()
                     except:
-- 
1.5.3.8

