
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2014-10-15 12:46 bygiampaolo.rodola, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| better_err_listfuncs_trace.patch | vajrasky,2014-10-19 07:53 | review | ||
| better_err_listfuncs_trace_v2.patch | vajrasky,2014-10-29 17:10 | review | ||
| issue22642.diff | SilentGhost,2016-01-12 10:13 | review | ||
| issue22642_2.diff | SilentGhost,2016-01-12 18:44 | review | ||
| Messages (13) | |||
|---|---|---|---|
| msg229441 -(view) | Author: Giampaolo Rodola' (giampaolo.rodola)*![]() | Date: 2014-10-15 12:46 | |
$ python3.4 -m trace -l Traceback (most recent call last): File "/usr/local/lib/python3.4/runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.4/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.4/trace.py", line 858, in <module> main() File "/usr/local/lib/python3.4/trace.py", line 787, in main progname = prog_argv[0]IndexError: list index out of rangeI would expect something more clear to be printed, like the program usage helper you get in this case:$ python3.4 -m trace /usr/local/lib/python3.4/trace.py: must specify one of --trace, --count, --report, --listfuncs, or --trackcalls | |||
| msg229674 -(view) | Author: Vajrasky Kok (vajrasky)* | Date: 2014-10-19 07:53 | |
Here is the patch. | |||
| msg230227 -(view) | Author: Vajrasky Kok (vajrasky)* | Date: 2014-10-29 17:10 | |
Thanks, Berker Peksag, for the review. Here is the updated patch with the test. | |||
| msg257959 -(view) | Author: Senthil Kumaran (orsenthil)*![]() | Date: 2016-01-11 14:28 | |
I reviewed the patch. It looks like the problem is not just with list functions but with other options too. Like.$ ./python.exe -m trace -t$ ./python.exe -m trace -c$ ./python.exe -m trace -TWill throw the same error. So, any changes should address all these cases instead of a single listfunctions (-l) case only. | |||
| msg257960 -(view) | Author: SilentGhost (SilentGhost)*![]() | Date: 2016-01-11 14:41 | |
I could submit a patch, but I'd switch over from getopt to argparse. I think this exactly the case when such a change is warranted. | |||
| msg257963 -(view) | Author: Senthil Kumaran (orsenthil)*![]() | Date: 2016-01-11 14:57 | |
@SilentGhost, I agree with you. I am making the change to use argparse as part of thisissue24649. And this bug could be covered as part of the change to argparse. | |||
| msg258097 -(view) | Author: SilentGhost (SilentGhost)*![]() | Date: 2016-01-12 10:13 | |
Here is the patch that incorporates earlier changes from Vajrasky's patch as well as wording from Evan's patch inissue24649. I've extended the test of failures, but I'm not sure if much can be done about the test of successful executions. I'm going to mark this issue as a superseder of theissue24649. | |||
| msg258106 -(view) | Author: Senthil Kumaran (orsenthil)*![]() | Date: 2016-01-12 15:57 | |
@SilentGhost,Thanks a lot for the quick turn around of a patch. I have left some review comments in reitveld. Please address them.Since this is underlying implementation change in option processing/parsing, it should only in feature release (3.6). Thank you! | |||
| msg258117 -(view) | Author: SilentGhost (SilentGhost)*![]() | Date: 2016-01-12 18:44 | |
Here is the updated version of the patch that addresses Senthil's comments. Besides re-flowing code, I've also added enforcement of --summary switch and re-factored and expanded the test_failures. It probably would be good if someone could test this on a real-life code. | |||
| msg258148 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-01-13 15:47 | |
New changeset0aa46b9ffba3 by Senthil Kumaran in branch 'default':Issue22642 - Convert trace module's option handling mechanism from getopt to argparse.https://hg.python.org/cpython/rev/0aa46b9ffba3 | |||
| msg258149 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-01-13 15:49 | |
New changeset69aa17b1f894 by Senthil Kumaran in branch 'default':Add a NEWS entry for Issue#22642.https://hg.python.org/cpython/rev/69aa17b1f894 | |||
| msg258150 -(view) | Author: Senthil Kumaran (orsenthil)*![]() | Date: 2016-01-13 15:51 | |
Thanks for the contribution. The option handling of trace module is modernized now.As berker suggested in one of the review comments, this module could see an increase in test coverage and we could deal with this as separate ticket. | |||
| msg258162 -(view) | Author: Berker Peksag (berker.peksag)*![]() | Date: 2016-01-13 19:41 | |
Thanks, Senthil. My comment was for Vajrasky's patch, not for the whole argparse switch. We need to add tests for the old getopt code first to avoid regressions. After0aa46b9ffba3, if we add tests we won't be able to test the old interface.My other comments:* SilentGhost needs to fill the contributor's agreement form. We generally accept trivial patches without asking CA, but I think we can't accept0aa46b9ffba3 without one since the patch is huge.* I don't think we add reST formatted docstring to stdlib. The javadoc style one in Trace.__init__() is 13 years old so we can ignore it.* I also have some minor comments, but I don't think they are important at this point :) | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:09 | admin | set | github: 66832 |
| 2016-01-13 19:41:38 | berker.peksag | set | nosy: +berker.peksag messages: +msg258162 |
| 2016-01-13 15:51:23 | orsenthil | set | status: open -> closed resolution: fixed messages: +msg258150 stage: patch review -> resolved |
| 2016-01-13 15:49:03 | python-dev | set | messages: +msg258149 |
| 2016-01-13 15:47:06 | python-dev | set | nosy: +python-dev messages: +msg258148 |
| 2016-01-12 18:44:39 | SilentGhost | set | files: +issue22642_2.diff messages: +msg258117 |
| 2016-01-12 15:57:22 | orsenthil | set | assignee:orsenthil messages: +msg258106 versions: - Python 3.5 |
| 2016-01-12 10:17:06 | SilentGhost | link | issue24649 superseder |
| 2016-01-12 10:13:41 | SilentGhost | set | files: +issue22642.diff title: trace module: unclear error message -> trace module: convert to argparse messages: +msg258097 versions: + Python 3.6, - Python 2.7, Python 3.4 |
| 2016-01-11 14:57:05 | orsenthil | set | messages: +msg257963 |
| 2016-01-11 14:41:05 | SilentGhost | set | nosy: +SilentGhost messages: +msg257960 |
| 2016-01-11 14:28:06 | orsenthil | set | nosy: +orsenthil messages: +msg257959 |
| 2014-10-29 17:10:05 | vajrasky | set | files: +better_err_listfuncs_trace_v2.patch messages: +msg230227 |
| 2014-10-19 16:47:26 | berker.peksag | set | type: behavior stage: needs patch -> patch review |
| 2014-10-19 07:53:34 | vajrasky | set | files: +better_err_listfuncs_trace.patch nosy: +vajrasky messages: +msg229674 keywords: +patch |
| 2014-10-15 18:43:09 | ned.deily | set | versions: + Python 2.7, Python 3.5 nosy: +belopolsky components: + Library (Lib) keywords: +easy stage: needs patch |
| 2014-10-15 12:46:20 | giampaolo.rodola | create | |