aigeano / pympler

Automatically exported from code.google.com/p/pympler
Apache License 2.0
0 stars 0 forks source link

TypeError in HtmlStats.create_html() if 'pct' of one item is greater than 3.0 #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
I'm using pympler (Rev: 283), and the attached reproducer is raising a 
TypeError for me

(pympler.bug)markus@thekorn /tmp/pympler.bug/pympler-read-only % python 
reproducer.py
---- SUMMARY ------------------------------------------------------------------
                                         active      5.24 MB      average   pct
  Test                                        1      1.91 MB      1.91 MB   36%
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File "reproducer.py", line 17, in <module>
    HtmlStats(tracker=tracker).create_html("/tmp/boo.html")
  File "/tmp/pympler.bug/pympler-read-only/pympler/tracker/stats.py", line 719, in create_html
    self.charts['snapshots'] = self.create_snapshot_chart(fn)
  File "/tmp/pympler.bug/pympler-read-only/pympler/tracker/stats.py", line 641, in create_snapshot_chart
    xp, yp = mlab.poly_between(x, base, sz)
  File "/usr/lib/pymodules/python2.6/matplotlib/mlab.py", line 2820, in poly_between
    Nx = len(x)
TypeError: object of type 'int' has no len()

The fix is as easy as renaming `x` in stats.py line 640

Thanks,
Markus

Original issue reported on code.google.com by markus.k...@gmail.com on 27 Aug 2010 at 9:41

Attachments:

GoogleCodeExporter commented 9 years ago
Proposed patch to fix this issue

Original comment by markus.k...@gmail.com on 27 Aug 2010 at 9:45

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Markus, thanks for the comprehensive bug report. This is fixed in r285.

Thanks, Ludwig

Original comment by lhae...@gmail.com on 12 Sep 2010 at 12:49