Opened 7 years ago

Closed 7 years ago

Last modified 5 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: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 7 years ago.
Initial patch (solves the issue). I'm not completely happy with it.
diff2.diff (1.3 KB) - added by Gabriel Farrell 7 years ago.
Slimmed down comment, made test more clear

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by Gabriel Farrell

The output, for reference, is an empty list.

$ python manage.py dumpdata
[]

comment:2 Changed 7 years ago by Alex Gaynor

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.

Changed 7 years ago by Alex Gaynor

Attachment: diff.diff added

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

comment:3 Changed 7 years ago by Alex Gaynor

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 Changed 7 years ago by Gabriel Farrell

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

Changed 7 years ago by Gabriel Farrell

Attachment: diff2.diff added

Slimmed down comment, made test more clear

comment:5 Changed 7 years ago by Russell Keith-Magee

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 Changed 7 years ago by Russell Keith-Magee

(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 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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