[New-bugs-announce] [issue28483] python --version prints output to stderr

Thomas Becker report at bugs.python.org
Thu Oct 20 03:01:05 EDT 2016


New submission from Thomas Becker:

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));
}
```

----------
components: Windows
messages: 279016
nosy: ctb, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python --version prints output to stderr
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28483>
_______________________________________


More information about the New-bugs-announce mailing list