#30305: Feature to set the returncode of a django custom command
-------------------------------+--------------------------------------
     Reporter:  stephanm       |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Uncategorized  |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by stephanm):

 I observed an other strange thing:

 if my `handle()`function returns a 1 (int) instead of a string I get the
 error like below,
 but if I return a 0 (again as int) I do **not** get the error below.

 Is this a magic thing in django or did I stuble over a python bug?

 {{{
 Traceback (most recent call last):
   File "D:\dev\eclipseworkspace\djtest\manage.py", line 12, in <module>
     execute_from_command_line(sys.argv)
   File "D:\Programme\python37\lib\site-
 packages\django\core\management\__init__.py", line 364, in
 execute_from_command_line
     utility.execute()
   File "D:\Programme\python37\lib\site-
 packages\django\core\management\__init__.py", line 356, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "D:\Programme\python37\lib\site-
 packages\django\core\management\base.py", line 283, in run_from_argv
     self.execute(*args, **cmd_options)
   File "D:\Programme\python37\lib\site-
 packages\django\core\management\base.py", line 339, in execute
     self.stdout.write(output)
   File "D:\Programme\python37\lib\site-
 packages\django\core\management\base.py", line 107, in write
     if ending and not msg.endswith(ending):
 AttributeError: 'int' object has no attribute 'endswith'
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30305#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.08e4f28eabec7282dad194c08903cd86%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to