Debugging exceptions thrown by loaddata

7 views
Skip to first unread message

Bram Duvigneau

unread,
Nov 4, 2009, 6:19:44 PM11/4/09
to django...@googlegroups.com
Hi all,

I'm trying to import a JSON fixture using loaddata. It gives me a
ProgrammingError because it seems that it's trying to put to much data
in a varchar. Without access to the variables in that scope, I'm quite
lost which record is causing this. Using "python -i manage.py loaddata
--traceback" doesn't give me the opportunity to debug this using the
pdb postmortem debugger because the --traceback option just prints the
traceback to stdout.

In an older revision, this would just raise the exception. However, this
behavior has been changed because raise always gives a TransactionError.
So, should I open/reopen a ticket because --traceback was added to help
with debugging? However, it is quite worthless in int's current state.
For now I'm just catching all errors that the save call in the loaddata
command generates and start pdb from there running set_trace. Are there
other/better ways to raise the original exception instead of the
TransactionError?

Bram

Reply all
Reply to author
Forward
0 new messages