decode 'payload' to utf-8 and ignore invalid bytes

This commit is contained in:
lm 2014-01-17 17:13:33 +08:00
parent 0a6316a2f3
commit 38e7f01ee8
1 changed files with 1 additions and 0 deletions

View File

@ -27,6 +27,7 @@ def set_description(desc, url):
def main():
#get payload from os env
payload_str = os.environ['payload']
payload_str = payload_str.decode('utf-8','ignore')
#parse to json obj
payload = json.loads(payload_str)