Skip to content

Wrong function names in error messages of os.spawnve(), os.preadv() and tkinter wm_attributes() #161179

Open

Description

@thejesh23

Bug report

Bug description:

Three error messages name a different function than the one that raised them.

  1. os.spawnve() (native implementation, Windows) reports spawnv() when the
    first element of argv is empty:

    >>> import os, sys
    >>> os.spawnve(os.P_NOWAIT, sys.executable, [''], {})
    ValueError: spawnv() arg 2 first element cannot be empty

    Expected: spawnve() arg 2 first element cannot be empty. All other
    messages in os_spawnve_impl already say spawnve().

  2. os.preadv() reports preadv2() when buffers is not a sequence:

    >>> import os
    >>> os.preadv(0, 42, 0)
    TypeError: preadv2() arg 2 must be a sequence

    Expected: preadv() arg 2 must be a sequence, matching os.pwritev(),
    which says pwritev() arg 2 must be a sequence.

  3. tkinter.Wm.wm_attributes() reports wm_attribute() (no "s") when options
    are passed both positionally and as keywords:

    >>> import tkinter
    >>> root = tkinter.Tk()
    >>> root.wm_attributes('alpha', alpha=0.5)
    TypeError: wm_attribute() options have been specified as positional and keyword arguments

    Expected: wm_attributes() options have been specified as positional and keyword arguments.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS (preadv, wm_attributes by code inspection plus a stubbed check);
the spawnve message is in the Windows-only native implementation and was
checked by code inspection only.

Linked PRs

Activity

  1. added a commit that references this issue on Nov 2, 2026
  2. added
    type-bugAn unexpected behavior, bug, or error
    stdlibStandard Library Python modules in the Lib/ directory
    on Nov 2, 2026
  3. added 2 commits that reference this issue on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directorytopic-tkintertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions