jeetsukumaran / Syrupy

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

Type error in -p and -c command #13

Open pandeyhs opened 7 years ago

pandeyhs commented 7 years ago

When I'm using -p command and -c command, it is giving this error

TypeError: decode() argument 1 must be string, not None

Nico769 commented 5 years ago

Probably you already got it working by now, so I hope this will benefit others who are having this issue (like I was).

You need to set your system's locale since ENCODING = locale.getdefaultlocale()[1] is getting None. To do so, I've done the following (I'm running a Debian based distribution).

apt-get update
apt-get install -y locales
# Uncomment the desired locale (e.g. it_IT.UTF-8 UTF-8) in /etc/locale.gen
sed -i 's/^# *\(it_IT.UTF-8 UTF-8\)/\1/' /etc/locale.gen
# Generate locale
locale-gen
# Export env vars
echo "export LC_ALL=it_IT.UTF-8 UTF-8" >> ~/.bashrc
echo "export LANG=it_IT.UTF-8 UTF-8" >> ~/.bashrc
echo "export LANGUAGE=it_IT.UTF-8 UTF-8" >> ~/.bashrc

For more info and credits, see here