Skip to content

Commit 8f5236f

Browse files
committed
[1.2.X] Fixed #13747 -- Reverted documentation suggesting the use of self.stdout/err in management commands in 1.2. Thanks to metamemetics for the report.
Strictly, self.stdout/err is a feature addition; however, it's a feature that is required in order to achieve a massive speedup in the tests and to maintain parity between 1.2.X and trunk tests. However, the feature is completely transparent -- the old technique will work fine, it just isn't as testable. Therefore, we'll treat this as an undocumented feature in the 1.2 branch. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent b1b1721 commit 8f5236f

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

docs/howto/custom-management-commands.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,7 @@ look like this:
6262
poll.opened = False
6363
poll.save()
6464

65-
self.stdout.write('Successfully closed poll "%s"\n' % poll_id)
66-
67-
.. note::
68-
When you are using management commands and wish to provide console
69-
output, you should write to ``self.stdout`` and ``self.stderr``,
70-
instead of printing to ``stdout`` and ``stderr`` directly. By
71-
using these proxies, it becomes much easier to test your custom
72-
command.
65+
print 'Successfully closed poll "%s"' % poll_id
7366

7467
The new custom command can be called using ``python manage.py closepoll
7568
<poll_id>``.

0 commit comments

Comments
 (0)