From ce54ef08933f2a5f1d65b6ed3b955763cadbf94a Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Thu, 21 Jul 2016 15:13:34 +0200 Subject: [PATCH] always turn strings into unicode in logger encoder --- wakatime/logger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wakatime/logger.py b/wakatime/logger.py index 525945c..a301712 100644 --- a/wakatime/logger.py +++ b/wakatime/logger.py @@ -13,7 +13,7 @@ import logging import os import traceback -from .compat import u +from .compat import basestring, u from .packages.requests.packages import urllib3 try: from collections import OrderedDict # pragma: nocover @@ -28,7 +28,7 @@ except (ImportError, SyntaxError): # pragma: nocover class CustomEncoder(json.JSONEncoder): def default(self, obj): - if isinstance(obj, bytes): # pragma: nocover + if isinstance(obj, basestring): obj = u(obj) return json.dumps(obj) try: # pragma: nocover