[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c76f1d78ff78 by Michael Foord in branch 'default':
Closes issue 16064. No longer hard code executable name in unittest help output.
http://hg.python.org/cpython/rev/c76f1d78ff78

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-28 Thread Arnav Khare

Arnav Khare added the comment:

Added comment explaining why we alter the executable string.

--
nosy: +Arnav.Khare
Added file: http://bugs.python.org/file27334/arnav.unittest.argv0.1.diff

___
Python tracker 

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



[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-28 Thread Larry Hastings

Larry Hastings added the comment:

Michael, you're the one who came up with the feature.  If you write the comment 
I'll fold it into the patch.

--

___
Python tracker 

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



[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-28 Thread Michael Foord

Michael Foord added the comment:

Yes it is for nicer help output, and a comment in the code is certainly 
warranted.

--

___
Python tracker 

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



[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

(I was just including the line for the convenience of anyone that might happen 
to come across the issue.  It was not to inform you of course! :) )

FWIW, if you already know from talking to Michael or looking at the code, I 
think a comment saying why sys.argv[0] is being rewritten in the first place 
would be useful.  For example, is it strictly to have a nicer-looking usage 
string for --help, or are there other reasons?

$ ./python.exe -m unittest --help
Usage: python -m unittest [options]
...

--

___
Python tracker 

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



[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-28 Thread Larry Hastings

Larry Hastings added the comment:

Certainly.  But what is the right thing to do?

I talked to Michael about it in person this morning, and our consensus was: use 
basename of sys.executable.

Patch attached.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file27325/larry.unittest.argv0.1.diff

___
Python tracker 

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



[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

It looks like the offending line is here:

http://hg.python.org/cpython/file/6ccb04c4cbae/Lib/unittest/__main__.py#l5

if sys.argv[0].endswith("__main__.py"):
sys.argv[0] = "python -m unittest"

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue16064] unittest -m claims executable is "python", not "python3"

2012-09-27 Thread Larry Hastings

New submission from Larry Hastings:

I wrote the following script called "bonkers.py":
--
import sys
print(sys.argv[0])
--

then ran
% python3 -m unittest bonkers

It printed
--
['python -m unittest', 'bonkers']
--

Shouldn't it say "python3", not "python"?  Maybe it should use sys.executable?  
(Though that gets tricky if there are spaces in the filename.)

--
assignee: michael.foord
components: Library (Lib)
messages: 171387
nosy: larry, michael.foord
priority: normal
severity: normal
stage: needs patch
status: open
title: unittest -m claims executable is "python", not "python3"
type: behavior
versions: Python 3.3

___
Python tracker 

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