Ticket #38 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Verbosity option has no fallback

Reported by: boyerchen@… Owned by: andrew
Priority: critical Milestone:
Component: commands Version: 0.6-pre
Keywords: Cc:


Since the verbose option was added, I can't call "migrate" by'migrate', app_label, '0001') for example.

CronJob[<PeriodicJob: autoupdate [p=5]>]: status=-1, message=Upgrade failed: Traceback (most recent call last):
  File "/home/django/http80/march/htdocs/march/apps/base/libs/cron/", line 54, in run
    if UpgradeClient().upgrade():
  File "/home/django/http80/march/htdocs/march/glibs/", line 93, in upgrade
  File "/home/django/http80/march/htdocs/march/glibs/", line 167, in _run_upgrade
    _upgrade.main(settings.PROJECT_ROOT, working_dir=self.extract_path)
  File "/tmp/march_upgrade_11696/", line 159, in main
  File "/tmp/march_upgrade_11696/", line 71, in upgrade
  File "/tmp/march_upgrade_11696/", line 119, in syncdb
  File "/home/django/http80/march/virtualenv/lib/python2.5/site-packages/Django-1.0.1.beta.1-py2.5.egg/django/core/management/", line 158, in call_command
    return klass.execute(*args, **options)
  File "/home/django/http80/march/virtualenv/lib/python2.5/site-packages/Django-1.0.1.beta.1-py2.5.egg/django/core/management/", line 219, in execute
    output = self.handle(*args, **options)
  File "/home/django/http80/march/virtualenv/lib/python2.5/site-packages/Django-1.0.1.beta.1-py2.5.egg/django/core/management/", line 348, in handle
    return self.handle_noargs(**options)
  File "/home/django/http80/march/virtualenv/lib/python2.5/site-packages/South-0.3-py2.5.egg/south/management/commands/", line 43, in handle_noargs
    verbosity = int(options.get('verbosity'))
TypeError: int() argument must be a string or a number, not 'NoneType'

Didn't try this yet, but maybe int(options.get('verbosity', 0)) would be enough to fix it.


Change History

comment:1 Changed 6 years ago by boyerchen@…

Hm, took a look at my own source again, it was caused by call_command('syncdb'), but the idea above fixed it in fact for me.

Index: management/commands/
--- management/commands/       (revision 89)
+++ management/commands/       (working copy)
@@ -40,7 +40,7 @@
                 # This is a migrated app, leave it
-        verbosity = int(options.get('verbosity'))
+        verbosity = int(options.get('verbosity', 1))
         # Run syncdb on only the ones needed
         if verbosity > 0:
             print "Syncing..."

comment:2 Changed 6 years ago by andrew

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

Yup, that looks about right - good point. I've checked in [90], which fixes this and one in ./ migrate - both default to 0, though, since I think that's a reasonable default to have.


Add a comment

Modify Ticket

as closed

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

Note: See TracTickets for help on using tickets.