Title: python --version prints output to stderr
Type: behavior Stage: resolved
Components: Windows Versions: Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: Python -V and --version output to stderr instead of stdout
View: 28160
Assigned To: Nosy List: ctb, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2016-10-20 07:01 by ctb, last changed 2016-10-20 07:03 by SilentGhost. This issue is now closed.

Messages (1)
msg279016 - (view) Author: Thomas Becker (ctb) Date: 2016-10-20 07:01
I am using Python 2.7.10 on Windows 8. While writing some code in NodeJS I noticed the following behaviour: `python --version` prints its output to stderr instead of stdout. 

In most cases this won't make any difference because both streams print to the screen. But if you want to handle the output streams separately it can cause confusion.

Here is a piece of code to reproduce this behaviour (requires nodeJs):

var exec = require('child_process').exec;

exec('python --version', function (err, stdout, stderr) {
    console.log('stdout: ' + JSON.stringify(stdout));
    console.log('stderr: ' + JSON.stringify(stderr));
Date User Action Args
2016-10-20 07:03:24SilentGhostsetstatus: open -> closed
superseder: Python -V and --version output to stderr instead of stdout
resolution: duplicate
stage: resolved
2016-10-20 07:01:05ctbcreate