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年05月09日 15:19 by ramiro, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| profile_example_fix.patch | jbmilam, 2015年06月04日 21:42 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg242812 - (view) | Author: Ramiro (ramiro) | Date: 2015年05月09日 15:19 | |
On the documentation page "The Python Profilers" https://docs.python.org/3.4/library/profile.html#instant-user-s-manual the following example is given: p.sort_stats('time', 'cum').print_stats(.5, 'init') This raises a KeyError, because 'cum' is not available as a sort key to pstats.Stats.sort_stats. As per the documentation of this method (https://docs.python.org/3.4/library/profile.html#the-stats-class) you can either use 'cumulative' or 'cumtime', which both work as expected. Since 'cumulative' is used a few examples earlier I suggest to use that for consistency. Tested with the following Python version: Python 3.4.3 on Ubuntu 15.04 |
|||
| msg244844 - (view) | Author: Brandon Milam (jbmilam) * | Date: 2015年06月04日 21:42 | |
They are correct. 'cum' is not one of the available keywords and so here is the fix changing it to say 'cumulative' for consistency as ramiro suggested. |
|||
| msg244860 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年06月05日 11:48 | |
New changeset bfc043eab54e by Berker Peksag in branch '3.4': Issue #24148: Fix incorrect Stats.sort_stats() example. https://hg.python.org/cpython/rev/bfc043eab54e New changeset ffb7019d70cf by Berker Peksag in branch '3.5': Issue #24148: Fix incorrect Stats.sort_stats() example. https://hg.python.org/cpython/rev/ffb7019d70cf New changeset 123419b216e0 by Berker Peksag in branch 'default': Issue #24148: Fix incorrect Stats.sort_stats() example. https://hg.python.org/cpython/rev/123419b216e0 |
|||
| msg244861 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2015年06月05日 11:50 | |
Fixed! Thanks for the report, ramiro and thanks for the patch, Brandon. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:16 | admin | set | github: 68336 |
| 2015年06月05日 11:50:49 | berker.peksag | set | status: open -> closed versions: + Python 3.5, Python 3.6 nosy: + berker.peksag messages: + msg244861 resolution: fixed stage: resolved |
| 2015年06月05日 11:48:59 | python-dev | set | nosy:
+ python-dev messages: + msg244860 |
| 2015年06月04日 21:42:05 | jbmilam | set | files:
+ profile_example_fix.patch nosy: + jbmilam messages: + msg244844 keywords: + patch |
| 2015年05月09日 15:19:17 | ramiro | create | |