Skip to content

Commit

Permalink
bugfix: run script and nocice script raise exception when include chi…
Browse files Browse the repository at this point in the history
…nese character
  • Loading branch information
blackholll committed Jun 15, 2019
1 parent 08c83b1 commit b64a75d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def run_flow_task(ticket_id, script_id_str, state_id, action_from='loonrobot'):
try:
with stdoutIO() as s:
# execfile(script_file, globals) # for python 2
exec(open(script_file).read(), globals)
exec(open(script_file, encoding='utf-8').read(), globals)
script_result = True
# script_result_msg = ''.join(s.buflist)
script_result_msg = ''.join(s.getvalue())
Expand Down Expand Up @@ -211,7 +211,7 @@ def send_ticket_notice(ticket_id):
try:
with stdoutIO() as s:
# execfile(script_file, globals) # for python 2
exec(open(notice_script_file).read(), globals)
exec(open(notice_script_file, encoding='utf-8').read(), globals)
script_result = True
# script_result_msg = ''.join(s.buflist)
script_result_msg = ''.join(s.getvalue())
Expand Down

0 comments on commit b64a75d

Please sign in to comment.