[wingide-users] Bug: cProfile.Profile doesn't make stats

cool-RR cool-rr at cool-rr.com
Fri Aug 6 12:14:45 MDT 2010

I came across a bug. I tried running cProfile from the shell (both debug
probe and regular shell.) When I do `cProfile.run('6**6**6')` it raises some
exception when trying to create stats after the run:

Traceback (most recent call last):

  File "C:\Python26\Lib\glob.py", line 1, in <module>

    """Filename globbing utility."""

  File "C:\Python26\Lib\cProfile.py", line 36, in run

    result = prof.print_stats(sort)

  File "C:\Python26\Lib\cProfile.py", line 81, in print_stats


  File "C:\Python26\Lib\pstats.py", line 92, in __init__


  File "C:\Python26\Lib\pstats.py", line 106, in init


  File "C:\Python26\Lib\pstats.py", line 135, in load_stats

    self.__class__, arg)

TypeError: Cannot create or construct a <class pstats.Stats at 0x012DA150>
> object from '<cProfile.Profile object at 0x012D45F0>''

I investigated a bit, and it turns out that the `cProfile.Profile` object,
after calling its `.create_stats()` method, has an empty `.stats` attribute.
I checked with the `profile` module, which should have almost identical
behavior, and `profile.Profile` *does* generate a stats. (So
`profile.run('6**6**6')` does work.)

This is happening in both Wing 3 and 4.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20100806/079bf2e6/attachment.html

More information about the wingide-users mailing list