jeetsukumaran / Syrupy

System Resource Usage Profiler
http://jeetworks.org/programs/syrupy
GNU General Public License v3.0
194 stars 27 forks source link

can't concat str to bytes #16

Open mauricev opened 4 years ago

mauricev commented 4 years ago

Invoking syrupy.py results in the following SYRUPY: Writing process resource usage samples to 'syrupy_20200223183224.ps.log' SYRUPY: Writing raw process resource usage logs to 'syrupy_20200223183224.ps.raw' SYRUPY: sampling top 5 processes by memory usage Traceback (most recent call last): File "./syrupy.py", line 717, in main() File "./syrupy.py", line 670, in main debug_level=opts.debug) File "./syrupy.py", line 299, in profile_process debug_level=debug_level) File "./syrupy.py", line 170, in poll_process raw_ps_log.write(stdout + "\n") TypeError: can't concat str to bytes

h-larsson commented 4 years ago

Get same error with python 3.7. It works for python2, though.

jeetsukumaran commented 4 years ago

The piped stdout is a byte vector. Needs to be converted to a string in Python 3.7. Simple one-liner. Will happily accept a PR, or otherwise will have to wait till I have time to do it myself.