From a69c50f470be354da11a3c21f3bec28f73ae1604 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Tue, 10 Jan 2017 10:05:24 -0800 Subject: [PATCH] use str on objects which are not strings --- WakaTime.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WakaTime.py b/WakaTime.py index 8584a2c..07b05e3 100644 --- a/WakaTime.py +++ b/WakaTime.py @@ -56,7 +56,10 @@ if is_py2: try: return unicode(text) except: - return text.decode('utf-8', 'replace') + try: + return text.decode('utf-8', 'replace') + except AttributeError: + return unicode(str(text)) elif is_py3: def u(text):