Opened 2 years ago

Closed 2 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


In django/core/management/commands/ 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 2 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 2 years ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 2 years ago by hoffmaje

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

comment:3 Changed 2 years ago by hoffmaje

  • 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 2 years ago by hoffmaje (next)

comment:4 Changed 2 years ago by hoffmaje

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

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

Changed 2 years ago by hoffmaje

comment:5 Changed 2 years ago by claudep

  • Resolution set to duplicate
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.