[Django] #21549: Fixture loading should fail with a BIG LOUD EXCEPTION when the file is not found

9 views
Skip to first unread message

Django

unread,
Dec 2, 2013, 4:30:26 PM12/2/13
to django-...@googlegroups.com
#21549: Fixture loading should fail with a BIG LOUD EXCEPTION when the file is not
found
-------------------------------+--------------------
Reporter: mpasternak | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Fixture lodaing should fail with an exception when there is no fixture
file in both loaddata AND unit tests.

Any reasons, why do we silently ignore the fact of missing fixture file
ATM?

If none, I can try working on a patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/21549>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 2, 2013, 4:31:59 PM12/2/13
to django-...@googlegroups.com
#21549: Fixture loading should fail with a BIG LOUD EXCEPTION when the file is not
found
-------------------------------------+-------------------------------------

Reporter: mpasternak | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by apollo13):

* needs_better_patch: => 0
* component: Uncategorized => Core (Management commands)
* needs_tests: => 0
* version: 1.6 => master
* needs_docs: => 0
* stage: Unreviewed => Accepted


Comment:

The current behavior of issuing a warning is indeed kind of odd.

--
Ticket URL: <https://code.djangoproject.com/ticket/21549#comment:1>

Django

unread,
Apr 14, 2014, 12:52:34 PM4/14/14
to django-...@googlegroups.com
#21549: Fixture loading should fail with a BIG LOUD EXCEPTION when the file is not
found
-------------------------------------+-------------------------------------
Reporter: mpasternak | Owner: bugZPDX
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by bugZPDX):

* status: new => assigned
* owner: nobody => bugZPDX


Comment:

The loaddata function in find_fixtures via load_label warns properly,
however something in the interactive command is masking the error. I will
continue investigating the issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/21549#comment:2>

Django

unread,
Jan 1, 2016, 8:32:18 AM1/1/16
to django-...@googlegroups.com
#21549: Fixture loading warning when the file is not found should be an exception
-------------------------------------+-------------------------------------
Reporter: mpasternak | Owner:
Type: | Status: new
Cleanup/optimization |

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* owner: bugZPDX =>
* status: assigned => new
* type: Bug => Cleanup/optimization
* easy: 0 => 1


Comment:

The idea is to change
[https://github.com/django/django/blob/98839e906632dfe77c6f6906d61d62868a0541dc/django/core/management/commands/loaddata.py#L241-L243
the warning] to `CommandError`. The warning about "No fixture data found"
in that same file might be able to be changed as well. Some tests will
need to be adapted and we'll need a mention in the release notes.

--
Ticket URL: <https://code.djangoproject.com/ticket/21549#comment:3>

Django

unread,
Jan 2, 2016, 12:34:34 AM1/2/16
to django-...@googlegroups.com
#21549: Fixture loading warning when the file is not found should be an exception
-------------------------------------+-------------------------------------
Reporter: mpasternak | Owner: soon
Type: | Status: assigned

Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by soon):

* status: new => assigned

* owner: => soon


--
Ticket URL: <https://code.djangoproject.com/ticket/21549#comment:4>

Django

unread,
Jan 2, 2016, 11:43:27 AM1/2/16
to django-...@googlegroups.com
#21549: Fixture loading warning when the file is not found should be an exception
-------------------------------------+-------------------------------------
Reporter: mpasternak | Owner: soon
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by soon):

Replying to [comment:3 timgraham]:


> The warning about "No fixture data found" in that same file might be
able to be changed as well. Some tests will need to be adapted and we'll
need a mention in the release notes.

''"No fixture data found"'' was an error before 2013, however it has been
changed to a warning with [https://github.com/django/django/pull/799 PR
#799]. Should it be implemented as error again?

--
Ticket URL: <https://code.djangoproject.com/ticket/21549#comment:5>

Django

unread,
Jan 2, 2016, 11:58:49 AM1/2/16
to django-...@googlegroups.com
#21549: Fixture loading warning when the file is not found should be an exception
-------------------------------------+-------------------------------------
Reporter: mpasternak | Owner: soon
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

Thanks for that research. We can keep it as is.

--
Ticket URL: <https://code.djangoproject.com/ticket/21549#comment:6>

Django

unread,
Jan 4, 2016, 7:43:41 PM1/4/16
to django-...@googlegroups.com
#21549: Fixture loading warning when the file is not found should be an exception
-------------------------------------+-------------------------------------
Reporter: mpasternak | Owner: soon
Type: | Status: closed

Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"d5b90c8e120687863c1d41cf92a4cdb11413ad7f" d5b90c8e]:
{{{
#!CommitTicketReference repository=""
revision="d5b90c8e120687863c1d41cf92a4cdb11413ad7f"
Fixed #21549 -- Made loaddata's 'fixture not found' warning an exception.

Thanks to mpasternak for the report and Tim Graham for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21549#comment:7>

Reply all
Reply to author
Forward
0 new messages