msg124271 - (view) |
Author: Silvio Ricardo Cordeiro (silvioricardoc) |
Date: 2010-12-18 03:10 |
The documentation at http://docs.python.org/dev/library/argparse.html explicitly says that "If file is None, sys.stderr is assumed". However, both print_usage and print_help assume sys.stdout when file=None. The helper method _print_message actually does it right, when called with file=None. |
|
|
msg124273 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-12-18 04:09 |
I think this is a documentation bug, since IMO help should print on stdout, not stderr[1]. I would expect print_usage to do likewise, but for the error to tell print_usage to write to stderr when it calls it...which is exactly what the code does. [1] I know some unix commands print help to stderr, and this really annoys me when I pipe long help output to less....and it *still* scrolls off the screen. |
|
|
msg124279 - (view) |
Author: Steven Bethard (bethard) *  |
Date: 2010-12-18 10:41 |
Yep, this is a documentation bug. Help is definitely intended to print to stdout. |
|
|
msg124289 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-12-18 16:40 |
Fixed in r87372. |
|
|
msg124368 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-12-19 23:35 |
This apparently lacks a 2.7 backport. |
|
|
msg124379 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-12-20 01:24 |
Like Georg, I'll get to that when I do a mass backport of all my doc fixes. My apologies for missing the beta2 deadline on doing that, but there aren't many of them. |
|
|
msg124400 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-12-20 19:25 |
Alright, I didn’t know you were doing mass merges. I personally prefer to leave reports open until backported, now I’ll know your habits. |
|
|
msg211217 - (view) |
Author: Dr. Jan-Philip Gehrcke (jgehrcke) * |
Date: 2014-02-14 12:25 |
The version action currently writes to stderr. The _VersionAction(Action)'s __call__() method finishes off with parser.exit(message=formatter.format_help()) and parser.exit() by default writes to stderr. Here, Steven says "Help is definitely intended to print to stdout." and I expected the same to happen regarding the version information. Why should it go to stderr? I see that this is a minor problem and only if someone here agrees I would open an issue for that. |
|
|