Code

Opened 3 years ago

Closed 3 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: UI/UX:

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

Attachments (0)

Change History (1)

comment:1 Changed 3 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

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?

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.