Skip to content

_wmi missing in sys.stdlib_module_names #123892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mtnpke opened this issue Sep 10, 2024 · 4 comments
Closed

_wmi missing in sys.stdlib_module_names #123892

mtnpke opened this issue Sep 10, 2024 · 4 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@mtnpke
Copy link

mtnpke commented Sep 10, 2024

Bug report

Bug description:

Given that import _wmi succeeds on a minimal Python distribution (embeddable amd64 downloaded from https://www.python.org/downloads/release/python-3130rc2/ for example), should _wmi not be included in sys.stdlib_module_names?

python-3.13.0rc2-embed-amd64 $ .\python.exe
Python 3.13.0rc2 (tags/v3.13.0rc2:ec61006, Sep  6 2024, 22:13:49) [MSC v.1940 64 bit (AMD64)] on win32
>>> import sys
>>> "_wmi" in sys.stdlib_module_names
False
>>> import _wmi
>>>

(My use case is that I am generating license exports automatically and any packages that are not resolvable to a distribution and not included in stdlib_module_names lead to an error or need special-casing.)

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs

@mtnpke mtnpke added the type-bug An unexpected behavior, bug, or error label Sep 10, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Sep 10, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Sep 10, 2024
@vstinner
Copy link
Member

should _wmi not be included in sys.stdlib_module_names?

Correct. I wrote PR gh-123893 to add it. Thanks!

@mtnpke
Copy link
Author

mtnpke commented Sep 10, 2024

That was fast! Thanks!

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 10, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 10, 2024
@vstinner
Copy link
Member

vstinner commented Sep 10, 2024

Fixed by fb1b51a. Backports will follow.

Sadly, the list of Windows extensions is maintained manually, and we forgot the _wmi extension. It's now fixed.

@vstinner
Copy link
Member

Thanks for the bug report @mtnpke.

vstinner added a commit that referenced this issue Sep 10, 2024
…123897)

gh-123892: Add "_wmi" to sys.stdlib_module_names (GH-123893)
(cherry picked from commit fb1b51a)

Co-authored-by: Victor Stinner <[email protected]>
Yhg1s pushed a commit that referenced this issue Sep 30, 2024
…123896)

gh-123892: Add "_wmi" to sys.stdlib_module_names (GH-123893)
(cherry picked from commit fb1b51a)

Co-authored-by: Victor Stinner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants