This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年02月09日 12:05 by rkuska, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| sort-choices.patch | rkuska, 2015年02月09日 12:05 | Add choices for sort option of cProfile | review | |
| sort-choices.patch | rkuska, 2015年02月09日 12:12 | missing space before imported module | review | |
| sort-choices.patch | rkuska, 2015年02月09日 12:51 | convert to list | review | |
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 9925 | merged | matrixise, 2018年10月17日 09:03 | |
| PR 9926 | merged | matrixise, 2018年10月17日 10:33 | |
| PR 9927 | merged | matrixise, 2018年10月17日 11:18 | |
| PR 9928 | merged | matrixise, 2018年10月17日 11:24 | |
| Messages (11) | |||
|---|---|---|---|
| msg235602 - (view) | Author: Robert Kuska (rkuska) * | Date: 2015年02月09日 12:05 | |
Originaly reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1160640 I've forgotten to add the sort value to the -s option of cProfile which results in a traceback instead of user friendly error message. In the example below hello.py just prints a "Hello World": $ python -m cProfile -s hello.py Traceback (most recent call last): File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code exec code in run_globals File "/usr/lib64/python2.6/cProfile.py", line 190, in <module> main() File "/usr/lib64/python2.6/cProfile.py", line 185, in main parser.print_usage() File "/usr/lib64/python2.6/optparse.py", line 1597, in print_usage print >>file, self.get_usage() File "/usr/lib64/python2.6/optparse.py", line 1583, in get_usage self.expand_prog_name(self.usage)) File "/usr/lib64/python2.6/optparse.py", line 1560, in expand_prog_name return s.replace("%prog", self.get_prog_name()) File "/usr/lib64/python2.6/optparse.py", line 1555, in get_prog_name return os.path.basename(sys.argv[0]) IndexError: list index out of range Tested with python2.7, python3.4 with the same result. Attached patch adds `choices` for sort option of cProfile. > $ python -m cProfile -s sdds.py Usage: cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ... cProfile.py: error: option -s: invalid choice: 'sdds.py' (choose from 'cumulative', 'module', 'ncalls', 'pcalls', 'file', 'line', 'name', 'calls', 'stdname', 'nfl', 'filename', 'cumtime', 'time', 'tottime') |
|||
| msg265765 - (view) | Author: Charalampos Stratakis (cstratak) * | Date: 2016年05月17日 11:03 | |
Any info regarding that? Patch seems good and it actually works. |
|||
| msg265813 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2016年05月18日 06:35 | |
Patch looks good to me, but we need a test case. |
|||
| msg292147 - (view) | Author: Louie Lu (louielu) * | Date: 2017年04月23日 03:07 | |
If we can solve #30118 for argument unittest, and apply #18971 for optparse to argparse, this issue will then can be solve, too. |
|||
| msg327876 - (view) | Author: Stéphane Wirtel (matrixise) * (Python committer) | Date: 2018年10月17日 09:04 | |
Hi, Just used the content of the patch and apply it on master, Add a unittest and the blurb entry. |
|||
| msg327884 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年10月17日 10:03 | |
New changeset fcd5e84a515e19409840c570730f0728e9fcfc83 by Victor Stinner (Stéphane Wirtel) in branch 'master': bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) https://github.com/python/cpython/commit/fcd5e84a515e19409840c570730f0728e9fcfc83 |
|||
| msg327891 - (view) | Author: miss-islington (miss-islington) | Date: 2018年10月17日 11:48 | |
New changeset 657e3f9a2c0d620807dd81882d566ad8f1ae423e by Miss Islington (bot) (Stéphane Wirtel) in branch '3.7': [3.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9926) https://github.com/python/cpython/commit/657e3f9a2c0d620807dd81882d566ad8f1ae423e |
|||
| msg327892 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年10月17日 11:48 | |
New changeset 669fa8b6376ee8703ae4383536dfcc0e96e51b78 by Victor Stinner (Stéphane Wirtel) in branch '3.6': [3.6] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9927) https://github.com/python/cpython/commit/669fa8b6376ee8703ae4383536dfcc0e96e51b78 |
|||
| msg327893 - (view) | Author: miss-islington (miss-islington) | Date: 2018年10月17日 11:51 | |
New changeset 6e57382464101d2669a425622e19fff57586b2ff by Miss Islington (bot) (Stéphane Wirtel) in branch '2.7': [2.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9928) https://github.com/python/cpython/commit/6e57382464101d2669a425622e19fff57586b2ff |
|||
| msg327894 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年10月17日 13:07 | |
Thanks Robert Kuska for the bug report and the initial patch, thanks Stéphane Wirtel for the PR (with the NEWS entry and the new test ;-)) |
|||
| msg327895 - (view) | Author: Stéphane Wirtel (matrixise) * (Python committer) | Date: 2018年10月17日 13:09 | |
welcome |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:12 | admin | set | github: 67608 |
| 2018年10月17日 13:09:22 | matrixise | set | messages: + msg327895 |
| 2018年10月17日 13:07:16 | vstinner | set | status: open -> closed versions: + Python 3.7, Python 3.8, - Python 3.5 messages: + msg327894 resolution: fixed stage: patch review -> resolved |
| 2018年10月17日 11:51:31 | miss-islington | set | messages: + msg327893 |
| 2018年10月17日 11:48:56 | vstinner | set | messages: + msg327892 |
| 2018年10月17日 11:48:09 | miss-islington | set | nosy:
+ miss-islington messages: + msg327891 |
| 2018年10月17日 11:24:12 | matrixise | set | pull_requests: + pull_request9281 |
| 2018年10月17日 11:18:56 | matrixise | set | pull_requests: + pull_request9280 |
| 2018年10月17日 10:33:48 | matrixise | set | pull_requests: + pull_request9279 |
| 2018年10月17日 10:03:50 | vstinner | set | messages: + msg327884 |
| 2018年10月17日 09:04:28 | matrixise | set | nosy:
+ matrixise messages: + msg327876 |
| 2018年10月17日 09:03:08 | matrixise | set | pull_requests: + pull_request9278 |
| 2018年10月10日 13:08:25 | vstinner | set | nosy:
+ vstinner |
| 2017年04月23日 03:07:16 | louielu | set | nosy:
+ louielu messages: + msg292147 |
| 2016年05月18日 06:35:15 | berker.peksag | set | type: enhancement -> behavior messages: + msg265813 versions: - Python 3.4 |
| 2016年05月17日 11:03:14 | cstratak | set | nosy:
+ cstratak messages: + msg265765 |
| 2015年07月31日 03:46:38 | zach.ware | set | versions: + Python 3.6 |
| 2015年02月14日 18:39:44 | sYnfo | set | nosy:
+ sYnfo |
| 2015年02月14日 18:27:56 | berker.peksag | set | nosy:
+ berker.peksag stage: patch review components: + Library (Lib), - Extension Modules versions: + Python 3.5 |
| 2015年02月09日 12:51:05 | rkuska | set | files: + sort-choices.patch |
| 2015年02月09日 12:12:52 | rkuska | set | files: + sort-choices.patch |
| 2015年02月09日 12:05:42 | rkuska | create | |