﻿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
20572	Localized PostgreSQL error messages break loaddata	gerard.henry@…	nobody	"Doing loaddata:
{{{
python manage.py loaddata -v 3 --traceback /tmp/mc1.json 
...
Traceback (most recent call last):
  File ""/Users/me/python/virtualenv/django15x/lib/python2.7/site-packages/django/core/management/base.py"", line 222, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/Users/me/python/virtualenv/django15x/lib/python2.7/site-packages/django/core/management/base.py"", line 255, in execute
    output = self.handle(*args, **options)
  File ""/Users/me/python/virtualenv/django15x/lib/python2.7/site-packages/django/core/management/commands/loaddata.py"", line 226, in handle
    e.args = (""Problem installing fixtures: %s"" % e,)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 126: ordinal not in range(128)
}}}
changing line 226 in loaddata.py (replace %s by %r), i see the error:
{{{
IntegrityError: Problem installing fixtures: IntegrityError('insert or update on table ""eventsmgmt_mycalendar"" violates foreign key constraint ""eventsmgmt_mycalendar_created_by_id_fkey""\nD\xc3\x89TAIL : Key (created_by_id)=(46) is not present in table ""auth_user"".\n',)
}}}
in the terminal, the locale is:
{{{
$localeLANG=""fr_FR.UTF-8""
LC_COLLATE=""fr_FR.UTF-8""
LC_CTYPE=""fr_FR.UTF-8""
LC_MESSAGES=""fr_FR.UTF-8""
LC_MONETARY=""fr_FR.UTF-8""
LC_NUMERIC=""fr_FR.UTF-8""
LC_TIME=""fr_FR.UTF-8""
LC_ALL=
}}}

the workaround is to change the locale to en_US:
{{{
$ export LANG=en_US.UTF-8
}}}
and it works"	Bug	closed	Core (Management commands)	1.5	Normal	wontfix			Accepted	0	0	0	0	0	0
