Opened 2 years ago

Closed 2 years ago

#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 2 years ago.

Download all attachments as: .zip

Change History (6)

Changed 2 years ago by weipin

comment:1 Changed 2 years 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 2 years 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 2 years ago by timo

  • Needs tests unset

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

comment:4 Changed 2 years 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 2 years 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.

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