Skip to content

update: Write certain errors to stderr #1251

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

Merged
merged 1 commit into from
Mar 3, 2016

Conversation

mrshu
Copy link
Contributor

@mrshu mrshu commented Feb 28, 2016

Signed-off-by: mr.Shu [email protected]

@ddfisher
Copy link
Collaborator

ddfisher commented Mar 1, 2016

These changes look good to me, but it still prints file not found errors (e.g. mypy: can't read file 'foo': No such file or directory) to stdout. Could you fix that up also?

print('\n*** INTERNAL ERROR ***')
print(s.rstrip('\n'), file=sys.stderr)
print('{}: {}'.format(type(err).__name__, err), file=sys.stderr)
print('\n*** INTERNAL ERROR ***', file=sys.stderr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd argue that it is intentional that the traceback is written to stdout but the final two messages are written to stderr. Though I don't feel strongly.

@gvanrossum
Copy link
Member

Pin? Are you going to update this PR?

@mrshu mrshu force-pushed the mrshu/errors-to-stderr branch from c12d70c to b06d6b2 Compare March 3, 2016 20:59
* As described and requested in python#1202, this commit makes errors on
  command line syntax and files not found to go to stderr rather than
  stdout.

Signed-off-by: mr.Shu <[email protected]>
@mrshu mrshu force-pushed the mrshu/errors-to-stderr branch from b06d6b2 to a978ec0 Compare March 3, 2016 21:03
@mrshu
Copy link
Contributor Author

mrshu commented Mar 3, 2016

Thanks for the comment @ddfisher, I believe it should be fixed now.

@gvanrossum I just did. Please do let me know if you have more comments or other feedback.

@gvanrossum
Copy link
Member

David, if you're happy you can merge this.

On Thursday, March 3, 2016, Marek Šuppa [email protected] wrote:

Thanks for the comment @ddfisher https://github.com/ddfisher, I believe
it should be fixed now.

@gvanrossum https://github.com/gvanrossum I just did. Please do let me
know if you have more comments or other feedback.


Reply to this email directly or view it on GitHub
#1251 (comment).

--Guido (mobile)

@ddfisher
Copy link
Collaborator

ddfisher commented Mar 3, 2016

This looks good to me. Thanks!

ddfisher added a commit that referenced this pull request Mar 3, 2016
update: Write certain errors to stderr
@ddfisher ddfisher merged commit 0ec0cb4 into python:master Mar 3, 2016
@gvanrossum
Copy link
Member

This PR actually reverted the key part of #1090, which was intended to write "regular" messages to stdout instead of stderr, per #1051. I will re-fix that without reverting the other parts of this PR -- errors about files not found and the like will continue to go to stderr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants