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 2013年05月22日 15:12 by jough, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue18033_py3.patch | dmi.baranov, 2013年05月27日 20:42 | review | ||
| issue18033_py2.patch | dmi.baranov, 2013年05月27日 20:42 | review | ||
| issue18033_py2.patch | ohe, 2013年07月03日 17:24 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg189823 - (view) | Author: Jough Dempsey (jough) | Date: 2013年05月22日 15:12 | |
The example on this page: http://docs.python.org/2/library/profile.html?highlight=pstats#profile.Profile Shows: import cProfile, pstats, io pr = cProfile.Profile() pr.enable() ... do something ... pr.disable() s = io.StringIO() ps = pstats.Stats(pr, stream=s) ps.print_results() Where "ps.print_results()" should be "ps.print_stats()" |
|||
| msg190153 - (view) | Author: Dmi Baranov (dmi.baranov) * | Date: 2013年05月27日 20:42 | |
Added py3 patch |
|||
| msg190154 - (view) | Author: Dmi Baranov (dmi.baranov) * | Date: 2013年05月27日 20:42 | |
py2 |
|||
| msg190823 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2013年06月08日 20:26 | |
Thanks for the patches, however the Python 2 example doesn't work. I think a BytesIO should be used instead of a StringIO, and print_stats() only returns a pstats.Stats instance, without actually printing any result. I wonder if print_results was an old method that has been removed and if now there's another way to print the results. I haven't tried on Python 3 yet, but the same comment might apply there too. |
|||
| msg190954 - (view) | Author: Armin Rigo (arigo) * (Python committer) | Date: 2013年06月11日 09:46 | |
A slightly more complete example that I tested: http://stackoverflow.com/a/16077568/1556290 |
|||
| msg192246 - (view) | Author: Olivier Hervieu (ohe) | Date: 2013年07月03日 17:24 | |
Here is a fixed version for python2.7. Using StringIO instead of io module fixes the problem pointed by Ezio. The print_stats method dumps the stats either on sys.stdout if `Stats` class is declared without a stream specification or in the given stream parameter (the name print_stats may be a bit misleading). |
|||
| msg197208 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年09月08日 00:52 | |
New changeset 93018d47793f by Senthil Kumaran in branch '2.7': Correct Profile class usage example. Addresses issue #18033 . http://hg.python.org/cpython/rev/93018d47793f New changeset ab4d3ccb92e6 by Senthil Kumaran in branch '3.3': Correct Profile class usage example. Addresses issue #18033. http://hg.python.org/cpython/rev/ab4d3ccb92e6 New changeset 88182b388bae by Senthil Kumaran in branch 'default': merge from 3.3 http://hg.python.org/cpython/rev/88182b388bae |
|||
| msg197209 - (view) | Author: Senthil Kumaran (orsenthil) * (Python committer) | Date: 2013年09月08日 00:53 | |
I consolidated the patches and example and have committed them to 2.7, 3.3 and 3.4. Thanks for your contributions. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:45 | admin | set | github: 62233 |
| 2013年09月08日 00:53:55 | orsenthil | set | status: open -> closed nosy: + orsenthil messages: + msg197209 resolution: fixed stage: patch review -> resolved |
| 2013年09月08日 00:52:47 | python-dev | set | nosy:
+ python-dev messages: + msg197208 |
| 2013年07月03日 17:24:13 | ohe | set | files:
+ issue18033_py2.patch nosy: + ohe messages: + msg192246 |
| 2013年06月11日 09:46:41 | arigo | set | nosy:
+ arigo messages: + msg190954 |
| 2013年06月08日 20:26:52 | ezio.melotti | set | stage: needs patch -> patch review messages: + msg190823 versions: + Python 3.3 |
| 2013年06月06日 09:40:47 | r.david.murray | link | issue18146 superseder |
| 2013年05月27日 20:42:59 | dmi.baranov | set | files:
+ issue18033_py2.patch messages: + msg190154 |
| 2013年05月27日 20:42:41 | dmi.baranov | set | files:
+ issue18033_py3.patch versions: + Python 3.4 nosy: + dmi.baranov messages: + msg190153 keywords: + patch |
| 2013年05月26日 13:44:25 | ezio.melotti | set | keywords:
+ easy nosy: + ezio.melotti stage: needs patch |
| 2013年05月25日 09:10:12 | pconnell | set | nosy:
+ pconnell |
| 2013年05月22日 15:12:38 | jough | create | |