GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — winreg.ExpandEnvironmentStrings() passes the buffer size as the error code on failure · Issue #161021 · python/cpython

winreg.ExpandEnvironmentStrings() passes the buffer size as the error code on failure #161021

New issue
Copy link
New issue
Copy link
Open
Open
winreg.ExpandEnvironmentStrings() passes the buffer size as the error code on failure#161021
Copy link
Labels
OS-windowstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@aisk
aisk
opened on Oct 31, 2026
Issue body actions

cpython/PC/winreg.c

Lines 1265 to 1266 in 2468c35

return PyErr_SetFromWindowsErrWithFunction(retValueSize,
"ExpandEnvironmentStrings");

retValueSize is the required buffer size returned by the first ExpandEnvironmentStringsW() call, but it is passed as the error code here, which raises an exception with a misleading error number.

Activity

  1. aisk
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    OS-windows
    on Oct 31, 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

    OS-windowstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.