Opened 5 years ago

Closed 4 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 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by Claude Paroz

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

comment:2 Changed 4 years ago by hoffmaje

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

comment:3 Changed 4 years ago by hoffmaje

Cc: hoffmaje added

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

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

comment:4 Changed 4 years ago by hoffmaje

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

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

Changed 4 years ago by hoffmaje

Attachment: loaddata_refactored.diff added

comment:5 Changed 4 years ago by Claude Paroz

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