[Django] #20933: manage.py loaddata stopped working on Django 1.6b2

29 views
Skip to first unread message

Django

unread,
Aug 18, 2013, 7:27:42 AM8/18/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
----------------------------------------------+--------------------
Reporter: static | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
Hello,

I have a script for loading fixtures that always worked in Django and it
suddenly stopped working on Django 1.6b2. It works on 1.5.1, 1.5.2 and
1.6b1.

### Create an app called appname and a folder called fixtures with a file
groups.yaml like this:
- fields:
name: Group1
permissions: []
model: auth.group
pk: 1
- fields:
name: Group2
permissions: []
model: auth.group
pk: 2
- fields:
name: Group3
permissions: []
model: auth.group
pk: 3

### Try run on terminal
python manage.py loaddata appname/fixtures/groups.yaml

### Output for Django 1.6b2
.../local/lib/python2.7/site-
packages/django/core/management/commands/loaddata.py:218: UserWarning: No
fixture named 'appname/fixtures/groups' found.
warnings.warn("No fixture named '%s' found." % fixture_name)

Installed 0 object(s) from 0 fixture(s)

(test was made using PostgreSQL with psycopg2 2.5.1 - I didn't had time to
test on other dbs)

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

Django

unread,
Aug 18, 2013, 7:59:08 AM8/18/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------

Reporter: static | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

The major refactoring in 51aa000378c00a442273f01142acdebc94dec68d may have
broken loading fixtures from an absolute path, but it was before 1.6b1.
Are you positive it still works in 1.6b1?

It would be extremely helpful if you could bisect to find the commit that
introduced the regression.

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

Django

unread,
Aug 18, 2013, 8:04:31 AM8/18/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------

Reporter: static | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by static):

I am sorry! I just noticed this error now (testing in 1.6). I am sure it
works on 1.5.1 and 1.5.2 not in 1.6b1.

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

Django

unread,
Aug 18, 2013, 8:09:19 AM8/18/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: assigned

Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Release blocker | 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 aaugustin):

* status: new => assigned
* owner: nobody => aaugustin
* stage: Unreviewed => Accepted


Comment:

Right. I must have broken loading fixtures from an absolute path — the
third option mentioned here: https://docs.djangoproject.com/en/dev/howto
/initial-data/#where-django-finds-fixture-files

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

Django

unread,
Aug 18, 2013, 8:17:55 AM8/18/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by static):

Testing done, it doesn't work in 1.6b1 either. I am sorry again.

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

Django

unread,
Aug 18, 2013, 8:18:32 AM8/18/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: assigned
Component: Database layer | Version:
(models, ORM) | 1.6-beta-1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by static):

* version: master => 1.6-beta-1


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

Django

unread,
Aug 20, 2013, 12:32:40 PM8/20/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: assigned
Component: Database layer | Version:
(models, ORM) | 1.6-beta-1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by apollo13:

Old description:

New description:

Hello,

--

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

Django

unread,
Aug 20, 2013, 12:38:17 PM8/20/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: assigned
Component: Database layer | Version:
(models, ORM) | 1.6-beta-1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by apollo13):

Replying to [comment:3 aaugustin]:


> Right. I must have broken loading fixtures from an absolute path — the
third option mentioned here: https://docs.djangoproject.com/en/dev/howto
/initial-data/#where-django-finds-fixture-files

No, absolute paths work as intended:
{{{
./manage.py loaddata `pwd`/appname/fixtures/groups
Installed 3 object(s) from 1 fixture(s)
}}}

The issue is relative paths, which aren't documented to work, though it
would make sense that they do, I'll see what I can do.

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

Django

unread,
Aug 20, 2013, 1:10:17 PM8/20/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: assigned
Component: Database layer | Version:
(models, ORM) | 1.6-beta-1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by apollo13):

https://github.com/django/django/pull/1492 Pull request with "not so
strict" validation of the path.

--
Ticket URL: <https://code.djangoproject.com/ticket/20933#comment:8>

Django

unread,
Aug 20, 2013, 3:27:12 PM8/20/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: closed

Component: Database layer | Version:
(models, ORM) | 1.6-beta-1
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Florian Apolloner <florian@…>):

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


Comment:

In [changeset:"96346ed5adf90849ac5ebd10d74377ed2e0c061c"]:
{{{
#!CommitTicketReference repository=""
revision="96346ed5adf90849ac5ebd10d74377ed2e0c061c"
Fixed #20933 -- Allowed loaddata to load fixtures from relative paths.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20933#comment:9>

Django

unread,
Aug 20, 2013, 3:28:32 PM8/20/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: closed
Component: Database layer | Version:
(models, ORM) | 1.6-beta-1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Florian Apolloner <florian@…>):

In [changeset:"12d364a9b0b4bf820a68104a64ba312c7290518b"]:
{{{
#!CommitTicketReference repository=""
revision="12d364a9b0b4bf820a68104a64ba312c7290518b"
[1.6.x] Fixed #20933 -- Allowed loaddata to load fixtures from relative
paths.

Backport of 6e846f7627ecf0dc15053624a23bfbf47535972d from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20933#comment:10>

Django

unread,
Aug 23, 2013, 7:41:43 AM8/23/13
to django-...@googlegroups.com
#20933: manage.py loaddata stopped working on Django 1.6b2
-------------------------------------+-------------------------------------
Reporter: static | Owner: aaugustin
Type: Bug | Status: closed
Component: Database layer | Version:
(models, ORM) | 1.6-beta-1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Andrew Godwin <andrew@…>):

In [changeset:"839940f27f25c2dafaa5b2ec934c2dd6b80903e8"]:
{{{
#!CommitTicketReference repository=""
revision="839940f27f25c2dafaa5b2ec934c2dd6b80903e8"


Fixed #20933 -- Allowed loaddata to load fixtures from relative paths.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20933#comment:11>

Reply all
Reply to author
Forward
0 new messages