Opened 5 years ago

Closed 5 years ago

#20509 closed Bug (fixed)

--pks option in dumpdata command raises exception

Reported by: Weipin Xia Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Release blocker Keywords:
Cc: bmispelon@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Issuing dumpdata command with --pks option results in a AttributeError exception.

 ./ dumpdata appname --pks 1
 AttributeError: 'list' object has no attribute 'split'

Attachments (1)

patch.diff (771 bytes) - added by Weipin Xia 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by Weipin Xia

Attachment: patch.diff added

comment:1 Changed 5 years ago by Claude Paroz

Needs tests: set
Patch needs improvement: set
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 Changed 5 years ago by Baptiste Mispelon

Cc: bmispelon@… added
Patch needs improvement: unset

The proposed patch just removes the (documented) ability to pass a comma-separated list of primary keys.

Here's my attempt at a better patch:

I'm not too sure how to write a regression test for this though...

comment:3 Changed 5 years ago by Tim Graham

Needs tests: unset

Added a test in this pull request:

comment:4 Changed 5 years ago by Baptiste Mispelon

Triage Stage: AcceptedReady for checkin

Looks good.

The added test fails without the patch and passes when it's applied.

I'm marking this as RFC.

comment:5 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 59235816bd063cb8b24acfc92ae1b5cd09a1f7ba:

Fixed #20509 - Proper parsing for dumpdata --pks option.

Thanks weipin for the report and Baptiste Mispelon for the patch.

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