﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18196	loaddata doesn't handle ImportError exception	nvalcarcel@…	nobody	"Steps to reproduce:
1. create a clean virtualenv
{{{virtualenv virtual}}}
2. install django 1.4
{{{pip install django==1.4}}}
3. create a project and app
4. add wadofstuff (don't install it on the virtenv)
{{{
SERIALIZATION_MODULES = {
    'json': 'wadofstuff.django.serializers.json'
}
}}}
5. run syncdb

Django will fail on line 123 of loaddata.py:

{{{formats = serializers.get_public_serializer_formats()}}}

with 

{{{*** ImportError: No module named wadofstuff.django.serializers.json}}}

but will trough this error:

{{{
Traceback (most recent call last):
  File ""manage.py"", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/__init__.py"", line 443, in execute_from_command_line
    utility.execute()
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/__init__.py"", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/base.py"", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/base.py"", line 232, in execute
    output = self.handle(*args, **options)
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/base.py"", line 371, in handle
    return self.handle_noargs(**options)
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py"", line 164, in handle_noargs
    call_command('loaddata', 'initial_data', verbosity=verbosity, database=db)
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/__init__.py"", line 150, in call_command
    return klass.execute(*args, **defaults)
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/base.py"", line 232, in execute
    output = self.handle(*args, **options)
  File ""/home/nxvl/dev/repuesport/virtual/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py"", line 239, in handle
    (full_path, ''.join(traceback.format_exception(sys.exc_type,
UnboundLocalError: local variable 'full_path' referenced before assignment
}}}

Issue is on the exception handler line 230."	Bug	closed	Core (Management commands)	1.4	Normal	fixed			Accepted	1	0	0	0	0	0
