Skip to content

Commit ae1ac02

Browse files
committed
bah
1 parent 8a828a4 commit ae1ac02

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎v3/web_exec.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ def cgi_finalizer(input_code, output_trace):
7070
else:
7171
form = cgi.FieldStorage()
7272
user_script = form['user_script'].value
73+
# for Python 2, immediately convert to utf-8 before passing input into program
74+
if hasattr(user_script, 'decode'):
75+
user_script = user_script.decode('utf-8')
7376
if 'raw_input_json' in form:
7477
raw_input_json = form['raw_input_json'].value
7578
if 'options_json' in form:

0 commit comments

Comments
 (0)