Opened 13 years ago

Closed 12 years ago

#17853 closed Bug (duplicate)

Fixture error output has wrong fixture name

Reported by: treborhudson@… Owned by: nobody
Component: Core (Management commands) Version: 1.4-beta-1
Severity: Normal Keywords:
Cc: hoffmaje Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In django/core/management/commands/loaddata.py it computes the full_path of the fixture files (~line 163) in a for loop, but all of that is wrapped up in a try/except block. If the naked Exception block (~line 231) is triggered, the full_path is often wrong. In the cases I've seen it, it's a completely different file and often with a '.bz2' extension, which I'm not using.

Attachments (1)

loaddata_refactored.diff (2.8 KB ) - added by hoffmaje 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Claude Paroz, 13 years ago

Triage Stage: UnreviewedAccepted

comment:2 by hoffmaje, 13 years ago

Even worse when having an exception there before full_path is even touched.

comment:3 by hoffmaje, 13 years ago

Cc: hoffmaje added

The attachment may be a first step for refactoring loaddata; the patch simply refactors the transaction rollback (3 occurences).

Version 0, edited 13 years ago by hoffmaje (next)

comment:4 by hoffmaje, 13 years ago

Updated patch: readability thing: parts[-1] is worth a variable file_extension.

Last edited 13 years ago by hoffmaje (previous) (diff)

by hoffmaje, 13 years ago

Attachment: loaddata_refactored.diff added

comment:5 by Claude Paroz, 12 years ago

Resolution: duplicate
Status: newclosed

This should be fixed by the patch uploaded to #18196.

Note: See TracTickets for help on using tickets.
Back to Top