jiffyclub/snakeviz

TypeError: 'int' object is not iterable

averri opened this issue · 1 comments

Running the tool with:

 snakeviz.exe app.prof

Starts the server and the browser shows the following errors:

Traceback (most recent call last):
  File "c:\dev\source\app\venv\lib\site-packages\tornado\web.py", line 1697, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "c:\dev\source\app\venv\lib\site-packages\snakeviz\main.py", line 36, in get
    table_rows=table_rows(s), callees=json_stats(s))
  File "c:\dev\source\app\venv\lib\site-packages\snakeviz\stats.py", line 63, in json_stats
    (keyfmt(*ck), list(cv)) for ck, cv in v.items())
  File "c:\dev\source\app\venv\lib\site-packages\snakeviz\stats.py", line 63, in <genexpr>
    (keyfmt(*ck), list(cv)) for ck, cv in v.items())
TypeError: 'int' object is not iterable

I have created the profile file with:

import profile

def count():
    res = []
    for n in range(10000):
        res.append(n)
    return res

profile.run('count()', filename='app.prof')

This is a known issue, see #84, #60. Snakeviz only works with profiles generated by the cProfile module, not those from the profile module. Sorry about that. 😞