Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cause:
cProfile doesn't output meaningful message when -s option is used without value
Consequence:
when cProfile's option -s is used without value it fails with vague error message
Fix:
when cProfile's option -s is used without value print error valuable error message
Result:
cProfile now prints to stdout all values which -s option supports when not supported is used or forgotten
DescriptionAlexander Todorov
2014-11-05 10:02:41 UTC
Description of problem:
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
Version-Release number of selected component (if applicable):
python-2.6.6-52.el6.x86_64
How reproducible:
always
In addition to this the list of possible sort values is not available and one needs to dig into the code to figure it out.
Comment 2Bohuslav "Slavek" Kabrda
2014-11-25 07:14:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHSA-2015-1330.html
Description of problem: 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 Version-Release number of selected component (if applicable): python-2.6.6-52.el6.x86_64 How reproducible: always In addition to this the list of possible sort values is not available and one needs to dig into the code to figure it out.