encode TimeZone as utf-8 before adding to headers
This commit is contained in:
parent
3ebc56fa41
commit
ce7448a6c2
2 changed files with 4 additions and 1 deletions
|
@ -14,3 +14,4 @@ SUCCESS = 0
|
|||
API_ERROR = 102
|
||||
CONFIG_FILE_PARSE_ERROR = 103
|
||||
AUTH_ERROR = 104
|
||||
UNKNOWN_ERROR = 105
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue