Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#12476 closed (fixed)

dumpdata with no arguments no longer dumps for all apps

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

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by gsf

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

The output, for reference, is an empty list.

$ python manage.py dumpdata
[]

comment:2 Changed 6 years ago by Alex

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 6 years ago by Alex

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

comment:3 Changed 6 years ago by Alex

  • Component changed from Serialization to Core framework
  • Has patch set
  • milestone set to 1.2
  • Triage Stage changed from Unreviewed to Accepted

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

comment:4 Changed 6 years ago by gsf

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

Changed 6 years ago by gsf

Slimmed down comment, made test more clear

comment:5 Changed 6 years ago by russellm

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

(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 6 years ago by russellm

(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 4 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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