Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12476 closed (fixed)

dumpdata with no arguments no longer dumps for all apps

Reported by: Gabriel Farrell Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As of r11952, dumpdata no longer outputs data for all apps when called with no arguments. May the gods help me figure out what changed.

Attachments (2)

diff.diff (1.3 KB ) - added by Alex Gaynor 15 years ago.
Initial patch (solves the issue). I'm not completely happy with it.
diff2.diff (1.3 KB ) - added by Gabriel Farrell 15 years ago.
Slimmed down comment, made test more clear

Download all attachments as: .zip

Change History (9)

comment:1 by Gabriel Farrell, 15 years ago

The output, for reference, is an empty list.

$ python manage.py dumpdata
[]

comment:2 by Alex Gaynor, 15 years ago

The issue is a list comprehension was replaced with a generator expression, and for some godforesaken reason SortedDict can't be instantiated with a genexpr:

>>> SortedDict((i, None) for i in xrange(2))
[2] {}

>>> SortedDict([(i, None) for i in xrange(2)])
[3] {0: None, 1: None}

IMO we should fix the root issue, although replacing the genexpr with a list comp is obviously the quick fix.

by Alex Gaynor, 15 years ago

Attachment: diff.diff added

Initial patch (solves the issue). I'm not completely happy with it.

comment:3 by Alex Gaynor, 15 years ago

Component: SerializationCore framework
Has patch: set
milestone: 1.2
Triage Stage: UnreviewedAccepted

I'm changing the component since that's the real issue.

comment:4 by Gabriel Farrell, 15 years ago

That patch makes sense. Heaven knows a way to set up the SortedDict without reading the data twice.

by Gabriel Farrell, 15 years ago

Attachment: diff2.diff added

Slimmed down comment, made test more clear

comment:5 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: newclosed

(In [12064]) Fixed #12476 -- Forced the rollout of generators passed to SortedDict so that the data source can be read twice. Thanks to gsf for the report, and Alex for the patch.

comment:6 by Russell Keith-Magee, 15 years ago

(In [12065]) [1.1.X] Fixed #12476 -- Forced the rollout of generators passed to SortedDict so that the data source can be read twice. Thanks to gsf for the report, and Alex for the patch.

Backport of r12064 from trunk.

comment:7 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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