Skip to content

Commit

Permalink
fix: encoding
Browse files Browse the repository at this point in the history
#20220401001
  • Loading branch information
YuCheng21 committed Mar 31, 2022
1 parent 54dd6c9 commit e28a530
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assistant_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def executor(self, directory):
if operation_system == 'Windows':
stdout = subprocess.check_output(specify_shell(command), shell=True, text=True, stderr=subprocess.STDOUT)
else: # Linux
stdout = subprocess.check_output(command, shell=True, text=True, stderr=subprocess.STDOUT, executable=SHELL.__str__())
stdout = subprocess.check_output(command, shell=True, text=True, encoding='unicode_escape',stderr=subprocess.STDOUT, executable=SHELL.__str__())
except subprocess.CalledProcessError as error:
logging.debug(f'execution failed, maybe compilation failed')
return [directory.name, self.COMPILE_FAIL]
Expand Down
12 changes: 10 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@
'output_pattern': [[r'(-1)+', r'(-7)+']],
}
week_args['week2'] = {
'Notes': '課堂完成(一元二次重根與無解)',
'Title': '課堂完成(一元二次重根與無解)',
}
week_args['week3'] = {
'Title': '一元二次(x, y可能是負數)',
'stdin': ["2", "-2"],
'output_pattern': [[r'((0\.25)+|(1\/4)+)']],
}
week_args['week4'] = {
'Notes': '課堂完成(算圓周率)',
'Title': '課堂完成(算圓周率)',
'stdin': [],
'output_pattern': [[r'((3)+|(14)+)']],
}
week_args['week5'] = {
'Title': '用函式找最大公因數',
'stdin': ["12", "18"],
'output_pattern': [[r'(6)']],
}

0 comments on commit e28a530

Please sign in to comment.