Code

#20509 closed Bug (fixed)

--pks option in dumpdata command raises exception

Reported by: weipin 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

Description

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

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

Attachments (1)

patch.diff (771 bytes) - added by weipin 11 months ago.

Download all attachments as: .zip

Change History (6)

Changed 11 months ago by weipin

comment:1 Changed 11 months ago by claudep

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement set
  • Severity changed from Normal to Release blocker
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 11 months ago by bmispelon

  • 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: https://github.com/django/django/pull/1227

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

comment:3 Changed 11 months ago by timo

  • Needs tests unset

Added a test in this pull request: https://github.com/django/django/pull/1231

comment:4 Changed 11 months ago by bmispelon

  • Triage Stage changed from Accepted to Ready 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 11 months ago by Tim Graham <timograham@…>

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

In 59235816bd063cb8b24acfc92ae1b5cd09a1f7ba:

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

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.