os.execvp on windows doesn't wait for the executed program to finish and doesn't report it's exit code
オープン
まだ誰も着手していません。
OS-windows
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
os.execvp on windows doesn't wait for the executed program to finish and doesn't report it's exit code. Code:
import os
import sys
if len(sys.argv) > 1 and sys.argv[1] == "my_argument":
sys.stderr.write("my_argument detected. Exiting with code 1.\n")
sys.exit(1)
else:
sys.stderr.write("no argument detected. Calling os.execvp\n")
os.execvp(sys.executable, [sys.executable] + sys.argv + ["my_argument"])
bat file:
@echo off
python exec.py
if %errorlevel% NEQ 0 (
echo The script gave exit code %errorlevel%
) else (
echo Error: The script exited with exit code 0
)
Output from command prompt:
C:\pythonizer\play>exec.bat
no argument detected. Calling os.execvp
Error: The script exited with exit code 0
C:\pythonizer\play>my_argument detected. Exiting with code 1.
Note the command prompt prompted me for a new command before the exec'd process wrote out it's message.
Your environment
- CPython versions tested on: 3.10.6
- Operating system and architecture: Windows 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された Python スクリプトとバッチ ファイルを使って Windows 10 の動作を再現し、次に os.execvp のエントリポイントとその Windows 実装を追跡します。実行されたプログラムがバッチ ファイルの処理継続前に終了し、その 0 以外の終了コードが呼び出し元に報告されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100