[issue18920] argparse module version action

Eli Bendersky report at bugs.python.org
Wed Sep 4 15:34:23 CEST 2013


Eli Bendersky added the comment:

On Wed, Sep 4, 2013 at 6:26 AM, Ezio Melotti <report at bugs.python.org> wrote:

>
> Ezio Melotti added the comment:
>
> Only on 3.4.
> Python prints the version on stdout since 3.4 -- before it used stderr:
> 3.3$ ./python -V 2> /dev/null
> 3.3$ ./python -V > /dev/null
> Python 3.3.2+
>
> 3.4$ ./python -V 2> /dev/null
> Python 3.4.0a1+
> 3.4$ ./python -V > /dev/null
>
> This might also explain why argparse uses stderr (other modules/scripts in
> the stdlib might do the same too).
>

Ah, right. On 3.4 Python's main.c uses printf for --version; on earlier
versions it's fprintf(stderr...)

I guess it's a no-brainer then; 3.4 has to be changed, but not earlier
versions. I'll whip up a quick patch.

----------

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


More information about the Python-bugs-list mailing list