[issue18920] argparse module version action

2013-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ec9a4b77f37b by Eli Bendersky in branch 'default':
Issue #18920: argparse's default version action (for -v, --version) should
http://hg.python.org/cpython/rev/ec9a4b77f37b

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-06 Thread Eli Bendersky

Eli Bendersky added the comment:

Thanks, I moved the NEWS entry to the right place. Yes, all tests pass. I'll 
update whatsnew separately.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 587bdb940524 by Eli Bendersky in branch 'default':
Update whatsnew/3.4 wrt. --version going to stdout. #18338, #18920, #18922
http://hg.python.org/cpython/rev/587bdb940524

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-06 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed
versions:  -Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-04 Thread Wolfgang Maier

New submission from Wolfgang Maier:

Hi,
I just noticed that version output generated via the
**'version' action** of the **argparse** module
is routed to stderr. I'd expect regular output to go to stdout instead.
The current behavior also seems inconsistent to me because --help
prints to stdout.
Best,
Wolfgang

--
messages: 196905
nosy: wolma
priority: normal
severity: normal
status: open
title: argparse module version action
type: behavior
versions: Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-04 Thread Eli Bendersky

Eli Bendersky added the comment:

Yes, it seems like an oversight to me. Printing --version to stdout is more 
customary (Python itself does it, and most other tools do too).

A question comes up about backwards compatibility. I would definitely not 
change it in 2.x - it's just not worth it. As for 3.x, should this go into 3.3 
too or just 3.4?

--
nosy: +bethard, eli.bendersky, serhiy.storchaka
versions: +Python 3.4 -Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-04 Thread Ezio Melotti

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).

--
keywords: +easy
nosy: +ezio.melotti
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-04 Thread Eli Bendersky

Eli Bendersky added the comment:

On Wed, Sep 4, 2013 at 6:26 AM, Ezio Melotti rep...@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 rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-04 Thread Eli Bendersky

Eli Bendersky added the comment:

The Python executable change is from #18338

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-04 Thread Eli Bendersky

Eli Bendersky added the comment:

Patch attached

--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file31587/issue18920.1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You misplace Misc/NEWS entry in wrong section -- What's New in Python 3.4.0 
Alpha 1.

I think this change (as change of issue18338) worths the mentioning in 
Doc/whatsnew/3.4.rst.

Did you run all test suite? This change can affect other tests.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18920] argparse module version action

2013-09-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 This might also explain why argparse uses stderr (other modules/scripts in 
 the stdlib might do the same too).

Lib/trace.py, Tools/pynche/Main.py, and Tools/i18n/pygettext.py write to the 
stdout.

Lib/smtpd.py and Tools/i18n/msgfmt.py write to the stderr.

The optparse module also writes to the stdout.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18920
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com