Proxy doesn't work, while executing jail_code there is no output displayed

オープン
#109 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
security

調査の方向性

まず、設定済みの CODEJAIL_TEST_USER/ENV および CODEJAIL_PROXY 設定で提供された Python スニペットを再現し、次に jail_code.jail_code(...) と proxy による stdout の処理を追跡します。進行中の出力が期待されているのか、それとも res.stdout のみがサポートされているのかを判断します。動作が明確になり、バグである場合は適切な回帰テストでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Hello,
I would like to execute this python code (containing a print statement and a sleep call for 1 second for each iteration of the range(5)).

The idea was to test and see if PROXY is working as desired. I was excepting to see while executing jail_code.jail_code(...) in the stdout of my terminal progressively displayed the numbers second by second:

1
2
3
4
full-output
- 0
- 1
- 2
- 3
- 4

but didn't happened..
First one should be the output printed by the proxy, and the second one is when I iterate on the result object stdout.

from codejail import jail_code
jail_code.set_limit("REALTIME", 20)
jail_code.set_limit("CPU", 100)
jail_code.set_limit("FSIZE", 10000)
jail_code.set_limit("PROXY", 1)

code = """
import time
for i in range(5):
    print(i)
    time.sleep(1)
"""

res = jail_code.jail_code(
    "python",
    code
)
print("full-output")
for line in res.stdout.decode('utf-8').split('\n'):
    print("-", line)

The issue here is that during this execution of jail_code.jail_code(...) the PROXY didn't seems to print anything in the output is that normal, I'm missing something ?
Thanks in advance.
PS: I have CODEJAIL_TEST_USER/ENV and CODEJAIL_PROXY configured in my ENV.

主要言語
Python
スター
477
フォーク
83
平均マージ
1日 8時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openedx/codejail のほかの issue

openedx/codejail の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。