Skip to content

gh-126931: Document the required first argument of os.spawn* functions - #163041

Open
lul-cas wants to merge 1 commit into
python:mainfrom
lul-cas:fix-issue-126931
Open

lul-cas wants to merge 1 commit into
python:mainfrom
lul-cas:fix-issue-126931

Conversation

@lul-cas

@lul-cas lul-cas commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

The docs say that os.spawn* must start with the name of the command being run, but it doesnt what that first argument is or what happens without it.

This pr adds a paragraph to the spawn entry saying that the first argument is the program own name (argv[0]), that it is required even when no other arguments are passed, and that ValueError is raised if its missing or empty. The wording follows what the "Process Management" introduction alrady says for the "exec" functions.

This behaviour is already covered by test_spawnl_noargs and the related tests, so this is docs only. Ive left function signatures unchanged

Fixes #126931.

…nctions

Explain that the first argument passed to the child process is its
argv[0], that it is required even when no other arguments are passed,
and that ValueError is raised if it is missing or empty.
@read-the-docs-community

Copy link
Copy Markdown

📖 1 file modified


Preview · build overview · cpython-previews · built Dec. 3, 2026, 12:06 a.m. UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Cannot os.spawnl with no arguments

1 participant