You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2021-12-04 00:25:10,652 INFO: Inferred exec file: ./main.go
Traceback (most recent call last):
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/bin/atcoder-tools", line 8, in <module>
sys.exit(main())
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/lib/python3.9/site-packages/atcodertools/atcoder_tools.py", line 64, in main
exit_program(tester_main(prog, args))
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/lib/python3.9/site-packages/atcodertools/tools/tester.py", line 420, in main
return run_all_tests(exec_file, in_sample_file_list, out_sample_file_list, args.timeout, args.knock_out,
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/lib/python3.9/site-packages/atcodertools/tools/tester.py", line 214, in run_all_tests
test_summary = run_for_samples(
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/lib/python3.9/site-packages/atcodertools/tools/tester.py", line 121, in run_for_samples
exec_res = run_program(exec_file, in_sample_file,
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/lib/python3.9/site-packages/atcodertools/executils/run_program.py", line 38, in run_program
proc = subprocess.run(
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/lib/python3.9/subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/user/.anyenv/envs/pyenv/versions/3.9.4/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: './main.go'
If the shell is invoked explicitly, via shell=True, it is the application's responsibility to ensure that all whitespace and metacharacters are quoted appropriately to avoid shell injection vulnerabilities.
Go言語において
atcoder-tools test
を実行すると、以下のエラーが発生し失敗します。(main.go自体のパーミッションは、
chmod u+x main.go
により.rwx r-x r-x
の権限付与済み)run_program.pyにおいて
subprocess.run
実行時の引数にshell=True
を指定すると、手元で正常に実行が完了します。が、Pythonのドキュメントによると
とのことです。
また、この箇所を変更した場合に他言語実行時への影響もありそうなため、どういった修正方針が良さそうか相談したいです。
The text was updated successfully, but these errors were encountered: