Code

Opened 7 years ago

Closed 7 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: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 7 years ago.
Preliminary patch looks like it fixes things

Download all attachments as: .zip

Change History (5)

comment:1 Changed 7 years ago by thomas@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

Changed 7 years ago by davisp

Preliminary patch looks like it fixes things

comment:2 Changed 7 years ago by davisp

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

comment:3 Changed 7 years ago by thomas@…

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 Changed 7 years ago by russellm

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

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

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.