Opened 11 years ago

Closed 11 years ago

#5375 closed (fixed) dumpdata fails because it doesn't inherit options_list from BaseCommand

Reported by: Matthew Flanagan <mattimustang@…> Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Running {{{ dumpdata}} fails with the following traceback:

Traceback (most recent call last):
  File "./", line 11, in ?
  File "/xxx/django/django/core/management/", line 163, in execute_manager
  File "/xxx/django/django/core/management/", line 107, in execute
    self.fetch_command(command_name, argv[0]).run(argv[1:])
  File "/xxx/django/django/core/management/", line 59, in run
    if options.settings:
AttributeError: Values instance has no attribute 'settings'

because it doesn't append its own options to the BaseCommand options_list.

Simple patch is

Index: django/core/management/commands/
--- django/core/management/commands/ (revision 6080)
+++ django/core/management/commands/ (working copy)
@@ -3,7 +3,7 @@
 from optparse import make_option

 class Command(BaseCommand):
-    option_list = (
+    option_list = BaseCommand.option_list + (
         make_option('--format', default='json', dest='format',
             help='Specifies the output serialization format for fixtures'),
         make_option('--indent', default=None, dest='indent', type='int',

Change History (1)

comment:1 Changed 11 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [6081]) Fixed #5375 -- Added base command options to the options registered against dumpdata. Thanks for the fix, Matthew Flanagan <mattimustang@…>.

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