Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python -v writes to stderr #79827

Closed
deepakjoshishri mannequin opened this issue Jan 3, 2019 · 5 comments
Closed

python -v writes to stderr #79827

deepakjoshishri mannequin opened this issue Jan 3, 2019 · 5 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@deepakjoshishri
Copy link
Mannequin

deepakjoshishri mannequin commented Jan 3, 2019

BPO 35646
Nosy @ericvsmith, @deepakjoshishri

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2019-01-03.07:59:30.640>
created_at = <Date 2019-01-03.07:37:42.996>
labels = ['interpreter-core', 'type-bug', 'invalid']
title = 'python -v writes to stderr'
updated_at = <Date 2019-01-03.09:21:30.916>
user = 'https://github.com/deepakjoshishri'

bugs.python.org fields:

activity = <Date 2019-01-03.09:21:30.916>
actor = 'Deepak Joshi'
assignee = 'none'
closed = True
closed_date = <Date 2019-01-03.07:59:30.640>
closer = 'eric.smith'
components = ['Interpreter Core']
creation = <Date 2019-01-03.07:37:42.996>
creator = 'Deepak Joshi'
dependencies = []
files = []
hgrepos = []
issue_num = 35646
keywords = []
message_count = 5.0
messages = ['332915', '332918', '332921', '332922', '332924']
nosy_count = 2.0
nosy_names = ['eric.smith', 'Deepak Joshi']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue35646'
versions = ['Python 2.7']

@deepakjoshishri
Copy link
Mannequin Author

deepakjoshishri mannequin commented Jan 3, 2019

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.

@deepakjoshishri deepakjoshishri mannequin added OS-windows topic-ctypes type-bug An unexpected behavior, bug, or error labels Jan 3, 2019
@ericvsmith
Copy link
Member

-v writes to stderr, so this is the expected behavior. Although maybe this could be better documented.

See bpo-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.

@ericvsmith ericvsmith added interpreter-core (Objects, Python, Grammar, and Parser dirs) and removed OS-windows topic-ctypes labels Jan 3, 2019
@ericvsmith ericvsmith changed the title Subprocess.Popen('python -v',stdout=PIPE,stderr=PIPE,Shell=True) gives output in stderr python -v writes to stderr Jan 3, 2019
@deepakjoshishri
Copy link
Mannequin Author

deepakjoshishri mannequin commented Jan 3, 2019

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 bpo-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\>


@ericvsmith
Copy link
Member

That's just the way it is with 2.7.

@deepakjoshishri
Copy link
Mannequin Author

deepakjoshishri mannequin commented Jan 3, 2019

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\>


@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant