diff options
| author | Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <srinivasreddy@users.noreply.github.com> | 2017-12-30 22:46:11 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-12-30 12:16:11 -0500 |
| commit | 58ec55b157b3c4cc9dc0a944804f8a719ff4e12f (patch) | |
| tree | 5bc79c4dd2fe2710389e6b99256b53b0453b8dbe /django | |
| parent | 51a00749e9d1814acfb6bf8732ecd21f18944083 (diff) | |
Fixed #28117 -- Added a helpful message in loaddata when psycopg2 can't load a fixture due to NUL characters.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/loaddata.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index da26c256ca..42dff67388 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -180,7 +180,8 @@ class Command(BaseCommand): '\rProcessed %i object(s).' % loaded_objects_in_fixture, ending='' ) - except (DatabaseError, IntegrityError) as e: + # psycopg2 raises ValueError if data contains NUL chars. + except (DatabaseError, IntegrityError, ValueError) as e: e.args = ("Could not load %(app_label)s.%(object_name)s(pk=%(pk)s): %(error_msg)s" % { 'app_label': obj.object._meta.app_label, 'object_name': obj.object._meta.object_name, |
