Opened 14 years ago

Closed 14 years ago

#14847 closed (worksforme)

dumpdata sends output to stderr, not stdout

Reported by: anonymous Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords: datadump
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

According to the documentation here: http://docs.djangoproject.com/en/dev/ref/django-admin/#dumpdata-appname-appname-appname-model ,
dumpdata "Outputs to standard output all data in the database associated with the named application(s)." However, it looks like it actually outputs to stderr, not stdout. Please see http://stackoverflow.com/questions/4368318/cannot-pipe-output-from-python-command

Change History (1)

comment:1 by Ramiro Morales, 14 years ago

Resolution: worksforme
Status: newclosed

Reviewing the code history for the dumpdata management command and the base command in general shows the output of the commands (the value returned from the handle method()) is sent explicitly to stdout.

Additionally, just tested this with the same manage.py invocation used by the OP of the SO discussion and Django 1.2.3. The JSON output is correctly sent to stdout.

Perhaps there is any additional detail about the environment where these tests were made?

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