[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

welcome

--

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

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

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread miss-islington

miss-islington  added the comment:


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


--

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


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


--

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread miss-islington

miss-islington  added the comment:


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


--
nosy: +miss-islington

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +9281

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +9280

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +9279

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


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


--

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi,

Just used the content of the patch and apply it on master,
Add a unittest and the blurb entry.

--
nosy: +matrixise

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-17 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +9278

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2018-10-10 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2017-04-22 Thread Louie Lu

Louie Lu added the comment:

If we can solve #30118 for argument unittest, and apply #18971 for optparse to 
argparse, this issue will then can be solve, too.

--
nosy: +louielu

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2016-05-18 Thread Berker Peksag

Berker Peksag added the comment:

Patch looks good to me, but we need a test case.

--
type: enhancement -> behavior
versions:  -Python 3.4

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2016-05-17 Thread Charalampos Stratakis

Charalampos Stratakis added the comment:

Any info regarding that? Patch seems good and it actually works.

--
nosy: +cstratak

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2015-07-30 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
versions: +Python 3.6

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



[issue23420] python -m cProfile -s fails with non informative message

2015-02-14 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
components: +Library (Lib) -Extension Modules
nosy: +berker.peksag
stage:  - patch review
versions: +Python 3.5

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



[issue23420] python -m cProfile -s fails with non informative message

2015-02-14 Thread Matěj Stuchlík

Changes by Matěj Stuchlík matej.stuch...@gmail.com:


--
nosy: +sYnfo

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



[issue23420] python -m cProfile -s fails with non informative message

2015-02-09 Thread Robert Kuska

New submission from Robert Kuska:

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

--
components: Extension Modules
files: sort-choices.patch
keywords: patch
messages: 235602
nosy: rkuska
priority: normal
severity: normal
status: open
title: python -m cProfile -s fails with non informative message
type: enhancement
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file38053/sort-choices.patch

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



[issue23420] python -m cProfile -s fails with non informative message

2015-02-09 Thread Robert Kuska

Changes by Robert Kuska rku...@gmail.com:


Added file: http://bugs.python.org/file38055/sort-choices.patch

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



[issue23420] python -m cProfile -s fails with non informative message

2015-02-09 Thread Robert Kuska

Changes by Robert Kuska rku...@gmail.com:


Added file: http://bugs.python.org/file38054/sort-choices.patch

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