encode TimeZone as utf-8 before adding to headers

This commit is contained in:
Alan Hamlett 2016-03-06 14:07:47 -08:00
parent 3ebc56fa41
commit ce7448a6c2
2 changed files with 4 additions and 1 deletions

View file

@ -14,3 +14,4 @@ SUCCESS = 0
API_ERROR = 102
CONFIG_FILE_PARSE_ERROR = 103
AUTH_ERROR = 104
UNKNOWN_ERROR = 105

View file

@ -36,6 +36,7 @@ from .constants import (
AUTH_ERROR,
CONFIG_FILE_PARSE_ERROR,
SUCCESS,
UNKNOWN_ERROR,
)
from .logger import setup_logging
from .offlinequeue import Queue
@ -356,7 +357,7 @@ def send_heartbeat(project=None, branch=None, hostname=None, stats={}, key=None,
except:
tz = None
if tz:
headers['TimeZone'] = u(tz.zone)
headers['TimeZone'] = u(tz.zone).encode('utf-8')
session_cache = SessionCache()
session = session_cache.get()
@ -499,3 +500,4 @@ def execute(argv=None):
return SUCCESS
except:
log.traceback()
return UNKNOWN_ERROR