Opened 17 years ago

Closed 17 years ago

#5566 closed (fixed)

Problem running django svn trunk (rev 6403): "NameError: global name 'subcommand' not defined"

Reported by: thomas@… Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Ran my unittests with django svn trunk last updated about 2 weeks ago (sorry, no longer have what rev that was) successfully. Updated to latest trunk (rev 6403) and then got this error:

thomas$ python manage.py test
2007-09-21 13:26:35,034:root:INFO:  Logging configured and ready to go.
Creating test database...
Traceback (most recent call last):
  File "manage.py", line 11, in ?
    execute_manager(settings)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management/__init__.py", line 264, in execute_manager
    utility.execute()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management/__init__.py", line 215, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management/base.py", line 70, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management/base.py", line 84, in execute
    output = self.handle(*args, **options)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management/commands/test.py", line 34, in handle
    failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/test/simple.py", line 142, in run_tests
    create_test_db(verbosity, autoclobber=not interactive)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/test/utils.py", line 152, in create_test_db
    call_command('syncdb', verbosity=verbosity, interactive=False)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management/__init__.py", line 120, in call_command
    klass = load_command_class(app_name, subcommand)
NameError: global name 'subcommand' is not defined

No code changes between test runs with previous and latest django revs.

Attachments (1)

fixed.patch (592 bytes ) - added by davisp 17 years ago.
Preliminary patch looks like it fixes things

Download all attachments as: .zip

Change History (5)

comment:1 by thomas@…, 17 years ago

Looks like this might have been introduced earlier today with changeset [6402].

by davisp, 17 years ago

Attachment: fixed.patch added

Preliminary patch looks like it fixes things

comment:2 by davisp, 17 years ago

This looks like a simple typo mixing up subcommand and name. I changed it and it makes things not spew out warnings.

comment:3 by thomas@…, 17 years ago

Confirmed: Changing subcommand to name on line 120 of django.core.management.__init__ resolved my error and my tests run successfully again. It was fun digging into that part of the django codebase :-)

comment:4 by Russell Keith-Magee, 17 years ago

Resolution: fixed
Status: newclosed

(In [6404]) Fixed #5566 -- Fixed typo from [6042]. Thanks to thomas@… and mir for bringing attention to this.

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