This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python --version prints output to stderr
Type: behavior Stage: resolved
Components: Windows Versions: Python 2.7
process
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 2022-04-11 14:58 by admin. 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));
}
```
History
Date User Action Args
2022-04-11 14:58:38adminsetgithub: 72669
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