#8055: Transaction error when doing loaddata
----------------------------------------------------+-----------------------
Reporter: Erik Allik <[email protected]> | Owner: nobody
Status: reopened | Milestone: post-1.0
Component: Serialization | Version: SVN
Resolution: | Keywords:
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
----------------------------------------------------+-----------------------
Comment (by tom_payne):
Well, I've had this problem again and have traced the error...
I was trying to insert null values into my booleanfield (which I shouldn't
be doing - that's what NullBooleanField is for - see #5563), but I think
it's more a question of raising any error like this.
Essentially, the bug is that you don't get a nice error message telling
you what's wrong, rather you get an irrelevant Transaction error because
the proper error message raises an exception.
The problem comes when this error is raised in loaddata.py
(django/core/management/commands/loaddata.py). The except clause (line 124
onwards) tries to print an error message using traceback.format_exc, but
this needs to be traceback.format_exception(sys.exc_type, sys.exc_value,
sys.exc_traceback). The _exc shortcut, IIRC, is only available to
print_exc.
I hope that's clear.
Tom
--
Ticket URL: <http://code.djangoproject.com/ticket/8055#comment:10>
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---