nvdv / vprof

Visual profiler for Python
BSD 2-Clause "Simplified" License
3.95k stars 154 forks source link

Fix decoding error on Python 3 #17

Closed jorisvandenbossche closed 8 years ago

jorisvandenbossche commented 8 years ago

This fixed the UnicodeDecodeError for me on python 3, while still working for python 2 (I wanted to profile a function to see the difference in performance between python 2 and 3 today .. :-)).

Just putting it up here, as I am not sure this is a good approach (bytes and strings in web things is not really my cup of tea). I now read in the files as bytes, so everything is bytes on both python 2 and 3. Only the json.dumps returns a string in python 3, so that still has to be converted to bytes.

nvdv commented 8 years ago

Hi, would you mind going through comments I left and I'll merge this PR right away? Thanks!

jorisvandenbossche commented 8 years ago

This should do it I think. Thanks for the feedback!

nvdv commented 8 years ago

Thanks! I hope this will fix #12.