Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7372] Regression in pstats

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 20, 2009, 5:03 PM

Post #1 of 5 (401 views)
Permalink
[issue7372] Regression in pstats

New submission from Alexander Belopolsky <belopolsky [at] users>:

Attached zip archive can be run directly to reproduce the bug:

$ ./python.exe bug.zip
Traceback (most recent call last):
File "/Users/sasha/Work/python-svn/trunk/Lib/runpy.py", line 162, in
_run_module_as_main
"__main__", fname, loader, pkg_name)
File "/Users/sasha/Work/python-svn/trunk/Lib/runpy.py", line 72, in
_run_code
exec code in run_globals
File "bug.zip/__main__.py", line 9, in <module>
File "/Users/sasha/Work/python-svn/trunk/Lib/pstats.py", line 268, in
strip_dirs
(cc, nc, tt, ct, newcallers))
File "/Users/sasha/Work/python-svn/trunk/Lib/pstats.py", line 516, in
add_func_stats
add_callers(t_callers, callers))
File "/Users/sasha/Work/python-svn/trunk/Lib/pstats.py", line 526, in
add_callers
zip(caller, new_callers[func])])
TypeError: zip argument #1 must support iteration


This is a regression introduced by r60149 which fixed processing of
cProfile data, but broke processing of profile.

It is fairly easy to fix this problem in pstats, but a better solution
may be to make profile output compatible with cProfile.

See also issue1269 and issue1315 .

----------
components: Library (Lib)
files: bug.zip
messages: 95574
nosy: belopolsky, georg.brandl, matthew.fremont, stromnov, therve
severity: normal
status: open
title: Regression in pstats
type: crash
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file15372/bug.zip

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7372>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 20, 2009, 6:20 PM

Post #2 of 5 (372 views)
Permalink
[issue7372] Regression in pstats [In reply to]

Alexander Belopolsky <belopolsky [at] users> added the comment:

I am attaching a simple fix. The test for data format could be taken out
of the loop, but it is probably not worth complicating the logic. In any
case the real issue is whether profile and cProfile should produce
compatible output or not.

----------
keywords: +patch
Added file: http://bugs.python.org/file15373/issue7372.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7372>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 21, 2009, 8:06 AM

Post #3 of 5 (370 views)
Permalink
[issue7372] Regression in pstats [In reply to]

Changes by Alexander Belopolsky <belopolsky [at] users>:


----------
versions: +Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7372>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 23, 2009, 12:31 PM

Post #4 of 5 (321 views)
Permalink
[issue7372] Regression in pstats [In reply to]

Georg Brandl <georg [at] python> added the comment:

Alexander, how hard would it be to change the profile output?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7372>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 23, 2009, 1:06 PM

Post #5 of 5 (317 views)
Permalink
[issue7372] Regression in pstats [In reply to]

Alexander Belopolsky <belopolsky [at] users> added the comment:

It would be fairly easy to change format before dumping stats to disk,
but unfortunately Profile does not encapsulate it's run-time data and
changing its format would be a mess.

Of course, one can hack around that by turning Profile.stats into a
computed property, but that's hardly an acceptable solution.

I think it is worthwhile fixing the on-disk format, but as a long-tem
solution one may consider adding common (possibly iterator-based) API
to both profile and cProfile that pstats can use instead of accessing
internal data structures.

Creating an ABC for a standard Python profiler, seems to be a
worthwhile project that in the future may simplify plugging in 3rd
party profilers, but I don't have expertise to undertake such a
project. That would require experience with multiple Python profilers
that I don't have.

On Mon, Nov 23, 2009 at 3:31 PM, Georg Brandl <report [at] bugs> wrote:
>
> Georg Brandl <georg [at] python> added the comment:
>
> Alexander, how hard would it be to change the profile output?
>
> ----------
>
> _______________________________________
> Python tracker <report [at] bugs>
> <http://bugs.python.org/issue7372>
> _______________________________________
>

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7372>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.