python / python/cpython

Cannot `os.spawnl` with no arguments

未關閉
#126,931 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs type-bug
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Bug report

Bug description:

Python 3.8 and 3.11.9

Probably related to: https://github.com/python/cpython/issues/52284
Seems to be the same as: https://github.com/python/cpython/issues/63130

A number of bugs:

    • Doesn't work with no arguements.
>>> os.spawnl(os.P_NOWAIT, "c:\path_to_some_program\app.exe")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen os>", line 930, in spawnl
ValueError: spawnv() arg 2 cannot be empty
  1. If I try and make the arguement empty it also fails. This means that I am forced to send an arguement that may trigger an unknown behaviour in the spawned application.:
>>> os.spawnl(os.P_NOWAIT, "c:\path_to_some_program\app.exe", '')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen os>", line 930, in spawnl
ValueError: spawnv() arg 2 first element cannot be empty
  1. If any aspect of this is intended, then the documentation needs to be updated to explicitly say this. Currently it implies any arguments are optional. (Honestly, the docs for this are bad generally.)
CPython versions tested on:

3.11

Operating systems tested on:

Windows

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 traceback 中顯示的 os.spawnl 實作以及 spawnl 和 spawnv 的相關文件著手。重現 Windows 下無引數和第一個引數為空的情況,然後確定預期行為,並更新實作或文件,使接受的引數要求明確且有測試涵蓋。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
operating-systems
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。