From 11e6c94ffa2663a8b1a717f0970ab0cbd2d52a6f Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Sun, 6 Mar 2016 13:00:00 -0800 Subject: [PATCH] encode unicode as basestring before passing to urllib3 --- wakatime/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wakatime/main.py b/wakatime/main.py index 232f4ea..6de441f 100644 --- a/wakatime/main.py +++ b/wakatime/main.py @@ -345,7 +345,7 @@ def send_heartbeat(project=None, branch=None, hostname=None, stats={}, key=None, 'Authorization': auth, } if hostname: - headers['X-Machine-Name'] = u(hostname) + headers['X-Machine-Name'] = u(hostname).encode('utf-8') proxies = {} if proxy: proxies['https'] = proxy