[Python-bugs-list] profile.py: self-profiling bug (PR#394)

akuchlin@mems-exchange.org akuchlin@mems-exchange.org
Fri, 7 Jul 2000 09:03:05 -0400 (EDT)


Full_Name: A.M. Kuchling
Version: 2.0cvs
OS: 
Submission from: cnri-7-237.cnri.reston.va.us (132.151.7.237)


Reported by jtravis@cse.unl.edu (Jon Travis) in comp.lang.python:

There is a small bug while running some of
the profiling code from within the profiler.  
Specifically:

import profile
x = profile.Profile()
x.run("x.dump_stats('/tmp/foo')")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "./Lib/profile.py", line 347, in run
    return self.runctx(cmd, dict, dict)
  File "./Lib/profile.py", line 353, in runctx
    exec cmd in globals, locals
  File "<string>", line 1, in ?
  File "./Lib/profile.py", line 322, in dump_stats
    self.create_stats()
  File "./Lib/profile.py", line 327, in create_stats
    self.simulate_cmd_complete()
  File "./Lib/profile.py", line 312, in simulate_cmd_complete
    self.t = self.get_time() - t
  File "./Lib/profile.py", line 191, in trace_dispatch_i
    if self.dispatch[event](frame,t):
  File "./Lib/profile.py", line 248, in trace_dispatch_return
    pt, ptt, pct, pfn, pframe, pcur = rcur
TypeError: unpack non-sequence

I have a small 2 liner fix, but I doubt it is correct,
merely a band-aid, so I won't post it.

-- Jon