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 -v writes to stderr
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Deepak Joshi, eric.smith
Priority: normal Keywords:

Created on 2019-01-03 07:37 by Deepak Joshi, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg332915 - (view) Author: Deepak Joshi (Deepak Joshi) Date: 2019-01-03 07:37
Subprocess.Popen('python -v',stdout=PIPE,stderr=PIPE,Shell=True)

Prduces output in stderr instead of stdout.

For others: pip --version or git --version output is in stdout and is expected.
msg332918 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2019-01-03 07:59
-v writes to stderr, so this is the expected behavior. Although maybe this could be better documented.

See issue 18338, where this was briefly discussed and a change was rejected.

Maybe you're looking for -V (uppercase) or --version, which do write to stdout, at least in 3.x. I'm not sure where they write in 2.7, but it's much too late to change 2.7's behavior.

I'm going to close this. If you find some of our documentation that says -v writes to stdout, then we can reopen this.

This is not a Windows specific error, so I'm modifying the nosy list.
msg332921 - (view) Author: Deepak Joshi (Deepak Joshi) Date: 2019-01-03 08:10
Hello,

-V and --version both write to stderr not stdout.

On Thu, 3 Jan 2019, 1:29 pm Eric V. Smith <report@bugs.python.org wrote:

>
> Eric V. Smith <eric@trueblade.com> added the comment:
>
> -v writes to stderr, so this is the expected behavior. Although maybe this
> could be better documented.
>
> See issue 18338, where this was briefly discussed and a change was
> rejected.
>
> Maybe you're looking for -V (uppercase) or --version, which do write to
> stdout, at least in 3.x. I'm not sure where they write in 2.7, but it's
> much too late to change 2.7's behavior.
>
> I'm going to close this. If you find some of our documentation that says
> -v writes to stdout, then we can reopen this.
>
> This is not a Windows specific error, so I'm modifying the nosy list.
>
> ----------
> components: +Interpreter Core -Windows, ctypes
> nosy: +eric.smith -paul.moore, steve.dower, tim.golden, zach.ware
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
> title: Subprocess.Popen('python -v',stdout=PIPE,stderr=PIPE,Shell=True)
> gives output in stderr -> python -v writes to stderr
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue35646>
> _______________________________________
>
msg332922 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2019-01-03 08:58
That's just the way it is with 2.7.
msg332924 - (view) Author: Deepak Joshi (Deepak Joshi) Date: 2019-01-03 09:21
Thank you for the reply Eric.
Thought the behaviour is pretty wierd and opened the issue.

On Thu, 3 Jan 2019, 2:28 pm Eric V. Smith <report@bugs.python.org wrote:

>
> Eric V. Smith <eric@trueblade.com> added the comment:
>
> That's just the way it is with 2.7.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue35646>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:59:09adminsetgithub: 79827
2019-01-03 09:21:30Deepak Joshisetmessages: + msg332924
2019-01-03 08:58:35eric.smithsetmessages: + msg332922
2019-01-03 08:10:39Deepak Joshisetmessages: + msg332921
2019-01-03 07:59:30eric.smithsetstatus: open -> closed

components: + Interpreter Core, - Windows, ctypes
title: Subprocess.Popen('python -v',stdout=PIPE,stderr=PIPE,Shell=True) gives output in stderr -> python -v writes to stderr
nosy: + eric.smith, - paul.moore, tim.golden, zach.ware, steve.dower

messages: + msg332918
resolution: not a bug
stage: resolved
2019-01-03 07:37:43Deepak Joshicreate