From: ZhuoX Li Date: Fri, 27 Jun 2014 08:12:39 +0000 (+0800) Subject: Fix the ascii encode issue about sending mail X-Git-Tag: 1.0~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=076eba00fd9fecc29f58bbbb8da5dedb33ad15d1;p=services%2Fjenkins-scripts.git Fix the ascii encode issue about sending mail When we send mail to submitter,need a specific format of address in job_request.py.Sometimes it maybe have the escape character, that causes the encode issue.We should check and change it. eg: '<stephane.desneux@open.eurogiciel.org>' should be changed to '' Fixes: #2010 Change-Id: Ib0d1b0c32f37a2a1f007ac8bc5e319f98f1175db --- diff --git a/job_request.py b/job_request.py index a98db08..c6d7cce 100755 --- a/job_request.py +++ b/job_request.py @@ -95,7 +95,11 @@ def obs_git_data(event_fields): mkey = mapping.get(key.strip()) if not mkey: continue - entry[mkey] = value.strip() + if key.strip() in ['Submitter']: + entry[mkey] = value.strip().replace('<', + '<').replace('>', '>') + else: + entry[mkey] = value.strip() except (AttributeError, ValueError): print '-------------------------------------' print 'key:value %s' % line